This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62A7:- v4l2h264enc extra-controls don't affect the "video_bitrate" & "video_bitrate_mode" parameters.

Part Number: AM62A7

Tool/software:

Hi Team,

We have observed that "video_bitrate" & "video_bitrate_mode" setting in pipeline not taking any impact. Not able to observed that configured "video_bitrate" value in VLC during stearming.


Command:-
===========================================
gst-launch-1.0 v4l2src device=/dev/video-rpi-cam0 io-mode=dmabuf-import ! \
video/x-bayer, width=1920, height=1200, format=rggb ! \
tiovxisp sink_0::device=/dev/v4l-rpi-subdev0 dcc-isp-file=/opt/imaging/ar0235/dcc_viss_8bit_1920x1200_narrow.bin sink_0::dcc-2a-file=/opt/imaging/ar0235/dcc_2a_8bit_1920x1200_narrow.bin format-msb=9 sink_0::ae-mode=2 ! \
video/x-raw, format=NV12, width=1920, height=1200 ! \
tiovxmultiscaler ! video/x-raw,width=960,height=600 ! \
v4l2h264enc extra-controls="c,video_gop_size=30,h264_profile=4,video_bitrate_mode=1, video_bitrate=16000,h264_level=9,h264_i_frame_period=512,prepend_sps_and_pps_to_idr=1" ! \
video/x-h264,profile=high ! mpegtsmux ! tcpserversink host=<Board-IP> port=5000

We have also checked by command "v4l2-ctl -d /dev/video1 --list-ctrls" in that case also we are not able to set the "video_bitrate" & "video_bitrate_mode" setting

Command Seq:-
v4l2-ctl -d /dev/video1 --get-ctrl=video_bitrate_mode
v4l2-ctl -d /dev/video1 --set-ctrl=video_bitrate_mode=0
v4l2-ctl -d /dev/video1 --get-ctrl=video_bitrate_mode
v4l2-ctl -d /dev/video1 --set-ctrl=video_bitrate_mode=1
v4l2-ctl -d /dev/video1 --get-ctrl=video_bitrate_mode

v4l2-ctl -d /dev/video1 --get-ctrl=video_bitrate
v4l2-ctl -d /dev/video1 --set-ctrl=video_bitrate=10000 --verbose
v4l2-ctl -d /dev/video1 --get-ctrl=video_bitrate

Note:- TI-SDK Version 09.01.00.06

Showing default value "video_bitrate: 0" & "video_bitrate_mode: 1 (Constant Bitrate)" in every case.


Thanks,
Nisarg

  • Hi Nisarg

    You would have to enable frame_level_rate_control_enable flag with extra controls when trying to test VBR/CBR modes.

    For your understanding,

    • frame_level_rate_control_enable
      • 0 : constant QP
      • 1 : select one of video_bitrate_mode
    • video_bitrate_mode
      • 0 : VBR (vbvBufferSize = 3000 . fixed. can't changed)
      • 1 : CBR (vbvBufferSize is set by vbv_buffer_size host set )

    Please check the below pipelines for example showcasing the bitrate changes:

    // CBR (RC enable + Bitrate + VBV buffer)
    gst-launch-1.0 filesrc location=./BasketballPass_416x240_50.yuv ! rawvideoparse width=416 height=240 format=i420 framerate=30/1 ! v4l2h264enc extra-controls="controls,video_bitrate=500000,frame_level_rate_control_enable=1,video_bitrate_mode=1,vbv_buffer_size=1000" ! filesink location=./avc_i420.bin

    // VBR
    gst-launch-1.0 filesrc location=./BasketballPass_416x240_50.yuv ! rawvideoparse width=416 height=240 format=i420 framerate=30/1 ! v4l2h264enc extra-controls="controls,video_bitrate=500000,frame_level_rate_control_enable=1,video_bitrate_mode=0,vbv_buffer_size=3000" ! filesink location=./avc_i420.bin

    Hope this helps
    Best Regards,
    Suren