jneilliii / OctoPrint-RTMPStreamer

22 stars 13 forks source link

A way to rotate video before streaming ? #55

Closed tavdog closed 4 months ago

tavdog commented 4 months ago

I would like to rotate the video as my camera is at 90 degrees. I can't figure out a way to rotate it. Maybe with the ffmpeg command ?

jneilliii commented 4 months ago

Yeah, you should be able to achieve that with vfilters (-vf) command I think. Quick search seems to indicate you need -vf "transpose=1"

For the transpose parameter you can pass:

0 = 90° counterclockwise and vertical flip (default) 1 = 90° clockwise 2 = 90° counterclockwise 3 = 90° clockwise and vertical flip

tavdog commented 4 months ago

Yes! This worked. Here is my updated ffmpeg command {ffmpeg} -re -f mjpeg -framerate {frame_rate} -i {webcam_url} {filter} -f lavfi -i anullsrc -acodec aac -ab 128k -s {stream_resolution} -vcodec {videocodec} -threads {threads} -pix_fmt yuv420p -framerate {frame_rate} -vf "transpose=1" -g {gop_size} -vb {bitrate} -strict experimental -f flv {stream_url}

tavdog commented 4 months ago

It does work but now the image is squashed. . . . oh nevermind, just had to change the stream resolution. to 480x640

jneilliii commented 4 months ago

@TheSin- you maybe have any ideas about the best way to rotate?

TheSin- commented 4 months ago

I would have thought the same though I would have though 3 not 1.

That being said does the input and output match in res? it's odd that it's squashing it.

tavdog commented 4 months ago

Setting the resolution to be 480x640 unsquashes it.

TheSin- commented 4 months ago

so it's working then?

tavdog commented 4 months ago

Yes it's working now.

On Mon, Apr 22, 2024, 2:13 AM Justin F. Hallett @.***> wrote:

so it's working then?

— Reply to this email directly, view it on GitHub https://github.com/jneilliii/OctoPrint-RTMPStreamer/issues/55#issuecomment-2069240786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7QJR6BBK577OFOXTLBF4DY6T5HLAVCNFSM6AAAAABGRCCRKOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRZGI2DANZYGY . You are receiving this because you modified the open/close state.Message ID: @.***>

TheSin- commented 4 months ago

excellent, happy to hear it.