This means the program you are using (such as ffmpeg) must set the options you want after it has opened the device. Each time they are opened a different instance is created, and the options are returned to their defaults. However for the hardware encoding/decoding devices, they can be opened multiple times. You could also change them while the device was already open. Previously the options were global - you'd set them once on /dev/video0 or whatever, and they would take effect when the device was later opened for capture. So when the V4L2 interface started providing hardware encoding/decoding, the method for setting these options changed. How should I modify the above series of commands in order to configure the keyframe interval, and while I'm there, also the H264 bitrate and/or quality settings? I therefore need to tell the hardware encoder to insert keyframes every few seconds, instead of the default which apparently only inserts one keyframe at the very start of the video. Apparently this error is because no keyframe has yet been received, and at least one key frame must be received before ffplay is able to start showing the video (because these frames include important things like the resolution of the video). If the video is already streaming when I launch ffplay, I get a bunch of errors saying non-existing PPS 0 referenced. It works, however when I use this command to view it, it only works if I start the viewer before streaming: ffplay -sync ext -an -fast -framedrop -probesize 32 -window_title picam02 udp://224.0.1.2:5004 While true do echo "PICAM02 $?C" > /tmp/msg sleep 1 done &įfmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x972 -use_wallclock_as_timestamps 1ĭrawtext=x=(w-tw-8):y=(h-32):fontcolor=white:fontsize=30:text=%,ĭrawtext=x=8:y=(h-32):fontcolor=white:fontsize=30:textfile=/tmp/msg:reload=1' I am using these commands to capture raw video from the Pi camera, draw the time and the Pi's temperature on the video, encode it to H264 with the hardware encoder, then stream it over the network: v4l2-ctl -v width=1280,height=972,pixelformat=YU12 TL DR When using ffmpeg and the h264_v4l2m2m hardware-accelerated codec, how do I set the encoder options such as the bitrate and key frame interval? Details
0 Comments
Leave a Reply. |