We are transcoding a motion JPEG stream to H.264 on an AM5728 processor, using TI’s “ducati” plugin for GStreamer.
The encoding seems to work all right, but I cannot figure out how to get a constant bitrate (CBR) stream.
Reading the source code suggests that “rate-preset=low-delay” should activate CBR mode, but the bitrate still varies.
I am using the following pipeline:
gst-launch-1.0 -e v4l2src device=/dev/video1 ! \
image/jpeg,width=1920,height=1080,framerate=60/1 ! \
videorate max-rate=30 drop-only=true ! \
queue max-size-buffers=1 leaky=upstream ! \
ducatijpegdec ! video/x-raw,format=NV12 ! \
ducatih264enc bitrate=1600 rate-preset=low-delay ! \
h264parse ! mp4mux faststart=true ! \
filesink location=out-1080p.mp4
So I would expect the bitrate to remain about 1600 kbps.
However, what I see in is:
• In a still scene, the bitrate is about 1390 kbps.
• In a scene with motion, the bitrate is about 3100 kbps.
How can we achieve a constant bitrate with the “ducati” encoder?