restreamer icon indicating copy to clipboard operation
restreamer copied to clipboard

rotate video 90 degrees and/or flip image

Open bubbapizza opened this issue 3 years ago • 5 comments

Hi I'm using restreamer to convert an RTSP stream to HLS for Octoprint. It works great when I use the .m3u8 URL.

I was just wondering if there's any way to rotate the image 90 degrees and/or flip the image. The rotate/flip checkboxes in Octoprint don't seem to work with HLS streams.

Thanks

bubbapizza avatar Jul 04 '21 15:07 bubbapizza

Hi @bubbapizza, did you check out the old issue https://github.com/datarhei/restreamer/issues/129 ? It requires that you re-encode the stream.

ioppermann avatar Jul 19 '21 15:07 ioppermann

Yes, for future reference for anyone reading this, I had to do this:

NOTE: to rotate the video 90 degrees, I logged into the restreamer container using:

 docker exec -it restreamer /bin/bash

Then added the "transpose=1" h264 filter to the /restreamer/conf/live.json file so it looks like this:

        "video_codec_h264": {
            "inputOptions": [],
            "outputOptions": [
                "-map 0:{videoid}",
                "-codec:v libx264",
                "-preset:v {preset}",
                "-b:v {bitrate}k",
                "-maxrate {bitrate}k",
                "-bufsize {bitrate}k",
                "-r {fps}",
                "-g {gop}",
                "-pix_fmt yuv420p",
                "-vsync 1",
	    "-vf transpose=1"
	]
        },

bubbapizza avatar Jul 24 '21 16:07 bubbapizza

@bubbapizza This function is now an official feature request and in progress for V2. You find the list here: https://github.com/datarhei/restreamer/discussions/345

cheerio Sven

svenerbeck avatar Jun 14 '22 13:06 svenerbeck

Hello @bubbapizza The v2.2.0 now supports video rotation & v/hflip. Here is a tutorial: https://docs.datarhei.com/restreamer/knowledge-base/user-guides/how-to-rotate-a-video

Cheers

jstabenow avatar Jul 22 '22 11:07 jstabenow

Nice!

bubbapizza avatar Aug 24 '22 15:08 bubbapizza