restreamer
restreamer copied to clipboard
rotate video 90 degrees and/or flip image
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
Hi @bubbapizza, did you check out the old issue https://github.com/datarhei/restreamer/issues/129 ? It requires that you re-encode the stream.
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 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
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
Nice!