lwc:multimedia_and_graphics:streaming

Streaming with nginx

Send a stream to nginx: ffmpeg -re -f video4linux2 -i /dev/video0 -vcodec libx264 -vprofile baseline -acodec none -x264-params keyint=30:scenecut=0 -strict -2 -f flv -pix_fmt yuv420p rtmp://<ip address>/show/stream

  • /show/stream is the stream url
  • keyint=30:scenecut=0 tells ffmpeg to do a new keyframe every 30 frames. Since this particular webcam is doing 30FPS that's 1 keyframe each second. This helps with latency since nginx is streaming per keyframe.

Testing nginx in foreground: sudo /usr/local/nginx/sbin/nginx -g 'daemon off;'

  • per these instructions create /etc/modprobe.d/uvcvideo.conf with content options uvcvideo quirks=0x0104
  • lwc/multimedia_and_graphics/streaming.txt
  • Last modified: 2022/09/09 10:35
  • by John Harrison