I am trying to stream video from a Logitech c920 to YouTube live via ffmpeg. I have a setup that works in Twitch, but YouTube rejects the stream with the message:
Please use a keyframe frequency of four seconds or less. Currently, keyframes are not being sent often enough, which will cause buffering. The current keyframe frequency is 9.9 seconds.
My command looks like this:
ffmpeg \ -ar 44100 \ -acodec pcm_s16le \ -f s16le \ -ac 2 -i /dev/null \ -f v4l2 \ -codec:v h264 \ -framerate 60 \ -video_size 1920x1080 \ -i /dev/video0 \ -c:v copy \ -c:a aac \ -f flv \ -strict -2 \ rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY
And in the logs ffmpeg gives this message:
[video4linux2,v4l2 @ 0x2965ec0] The driver changed the time per frame from 1/60 to 1/30
Does anyone know a way to force the camera, v4l2 or ffmpeg to provide keyframes at a suitable rate?