Sample Header Ad - 728x90

Adjusting keyframe rate ffmpeg/v4l2 Logitech C920 to YouTube Live

2 votes
1 answer
1757 views
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? Thanks.
Asked by Dan (21 rep)
Jan 25, 2017, 06:40 AM
Last activity: Sep 26, 2023, 08:07 PM