Skip to content

Instantly share code, notes, and snippets.

@unbelauscht
Last active April 8, 2024 15:05
Show Gist options
  • Save unbelauscht/3e1344ac01a3add5a81a793e3a4ba2c9 to your computer and use it in GitHub Desktop.
Save unbelauscht/3e1344ac01a3add5a81a793e3a4ba2c9 to your computer and use it in GitHub Desktop.
stream webcam in h264 with hardware encoding to rtmp server like owncast
ffmpeg -f lavfi -i anullsrc -f v4l2 -r 5 -video_size 1920x1080 -i "/dev/video0" -c:v h264_omx -preset ultrafast -b:v 1000k -c:a aac -f flv 'rtmp://x.x.x.x/live/streamkey'
# rotate and crop
ffmpeg -f lavfi -i anullsrc -f v4l2 -r 1 -video_size 1920x1080 -i "/dev/video0" -vf "transpose=2,crop=1080:1080:960:540" -c:v h264_omx -preset ultrafast -b:v 1000k -c:a aac -f flv 'rtmp://x.x.x.x:xxxx/live/streamkey'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment