Alternate Video Streams

Started looking at an alternate video stream that @FormerLurker, in an alternate issue, pointed me at https://datarhei.github.io/restreamer/

I was able to take an Wyze camera with the RTSP firmware and I can get two feeds

  1. Video feed via internal player: http://odroid.local:8080/player.html
  2. Snapshot feed: http://odroid.local:8080/images/live.jpg

I can easily configure the snapshot in Octoprint, however the video feed I have not been able to configure with Octoprint.

Was hopeful that someone might have an idea, or can point me in the right direction.

Thanks!

It's the .html part of your video feed that is giving you problems. You might be able to open up the html page and find the actual video feed url within. You could 'view page source' by right clicking on the screen, and post the html code somewhere and leave a link in here for us to review. I can't promise it will work, but it's worth a shot!

I've captured the source .html and it looks like the output launches several javascript .js files, however I see that this is in the script section:

    var config = {
        source: 'hls/live.stream.m3u8',
        parentId: '#player',
        baseUrl: 'libs/scripts/',
        plugins: plugins,
        poster: 'images/live.jpg?t=' + String(new Date().getTime()),
        mediacontrol: {'seekbar': color, 'buttons': color},
        height: '100%',
        width: '100%',
        disableCanAutoPlay: true,
        autoPlay: autoplay,
        mute: mute,
        clapprStats: {
            runEach: 1000,
            onReport: (metrics) => {},
        },
        clapprNerdStats: {
            shortcut: ['command+shift+s', 'ctrl+shift+s'],
            iconPosition: 'top-right'
        }
    };

That looks interesting. Try changing that into an absolute path (http://{ip_of_camera}/hls/live.stream.m3u8) and see if you can play it with something like VLC before testing it out in OctoPrint. I'm not sure if it will support such a stream, but it's worth a shot.

I'll have to give it a try again.. I stopped last night when VLC updating.

Restreamer provides the following iframe to embed into a web site:
<iframe src="http://<IP_of_Server>:8080/player.html" name="restreamer-player" width="800" height="450" scrolling="no" frameborder="0" webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen="true"></iframe>

@FormerLurker, the feed can be opened and played in VLC player via URL:

http://odroid.local:8080/hls/live.stream.m3u8

There is a slight delay, but probably due to the restreaming process (RTSP to HTTP)

Next idea; adding a HLS player into Octoprint?

Great! Next step is to try in octoprint. I actually doubt it will work, but there is only one way to tell. If it doesn't work you can always remove the link. Let me know how it goes!

I already tried adding in the URL into Octoprint and it didn't work.
That is why I'm guessing a plug-in would need to be created to support the HLS video feed.

There are some chrome extensions that will allow playing of the feed directly in the browser w/o needing VLC, but getting it integrated with Octoprint is where I'll be out of my comfort due to Python not being a language I know yet.

Received an email from the Developer of Restreamer:

Thanks for using Restreamer.

Restreamer doesn't provide the stream as MJPEG and it is currently not planned to do so. Is it in Octoprint not possible to embed a player in an iframe? Then you could use the player from Restreamer?

Regards
Ingo

Looks like a plug-in to use the built-in Restreamer player iframe will be the direction to go.

Not sure I'm the best person to dive into this as the combination of Restreamer with Octoprint could be beneficial for both the player ifrmae and snapshot URL.

@FormerLurker would using the snapshot URL work for Octolapse?

<img src="http://odroid.local:8080/images/live.jpg" width="800" height="450">

If I enter http://odroid.local:8080/images/live.jpg into Octoprints "Snapshot URL", the image opens with no issues.

Restreamer has an adjustable refresh timer on the snapshots. I think the default is 60 seconds.

I'll have to reach out to Gaston Dombiak regarding Octopod and Michael Morris of the MultCam.

Anyone else use video feeds in plug-ins?

You could use the URL, but even an update time of 1 second would be excessive. You would have to use 1000MS at least (maybe 2000) for the octolapse camera delay in order to get a stabile timelapse, which would probably cause some oozing.

Octolapse induces a pause in order to take a stable snapshot, correct?

Restreamer just takes the snapshot on a schedule, and provides it via the snapshot URL. Basically making use of it more like Octoprint's built-in timelapse process.

Guess it wouldn't work with Octolapse unless Restreamer has a snapshot triggering mechanism?