i.MX 8X VPU H.264 Encoding Constant Bitrate

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX 8X VPU H.264 Encoding Constant Bitrate

42 Views
ha1234
Contributor I

Hi there,

We are using the i.MX 8X (On a Digi ConnectCore 8X Pro) to encode video at a constant bitrate with gstreamer. After updating our BSP, we have found that the encoder is not reaching the requested bitrate.

This is reproducible with the 'ball' test source in gstreamer (with 300 frames and 30fps we would expect a filesize of around 5MB at 4000Kbps)

gst-launch-1.0 -e videotestsrc pattern=ball num-buffers=300 ! video/x-raw,format=NV12,width=640,height=512,framerate=30/1 ! v4l2h264enc extra-controls="controls,video_bitrate_mode=1,video_bitrate=4000000,video_b_frames=0" ! "video/x-h264,profile=baseline,level=(string)4" ! h264parse ! filesink location=out.h264

 

On encoder firmware version 1.3.0, this results in a file size of 4980939 bytes (~5MB), vs on 1.4.5 the result is only 102994 bytes (~0.1MB). 

Could you confirm that this is a known regression in the firmware and whether there is a workaround to use constant bitrate?

Tested platform details:

  • kernel 6.6.52 (digi embedded yocto)
  • gstreamer 1.24.7

 

Tags (3)
0 Kudos
Reply
1 Reply

2 Views
ha1234
Contributor I

Based on another test I've done, I believe this to be working with encoder version 1.4.1 but not 1.4.5, so I assume it is a regression between these versions

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2411718%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ei.MX%208X%20VPU%20H.264%20Encoding%20Constant%20Bitrate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2411718%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20there%2C%3C%2FP%3E%3CP%3EWe%20are%20using%20the%20i.MX%208X%20(On%20a%20Digi%20ConnectCore%208X%20Pro)%20to%20encode%20video%20at%20a%20constant%20bitrate%20with%20gstreamer.%20After%20updating%20our%20BSP%2C%20we%20have%20found%20that%20the%20encoder%20is%20not%20reaching%20the%20requested%20bitrate.%3C%2FP%3E%3CP%3EThis%20is%20reproducible%20with%20the%20'ball'%20test%20source%20in%20gstreamer%20(with%20300%20frames%20and%2030fps%20we%20would%20expect%20a%20filesize%20of%20around%205MB%20at%204000Kbps)%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Egst-launch-1.0%20-e%20videotestsrc%20pattern%3Dball%20num-buffers%3D300%20!%20video%2Fx-raw%2Cformat%3DNV12%2Cwidth%3D640%2Cheight%3D512%2Cframerate%3D30%2F1%20!%20v4l2h264enc%20extra-controls%3D%22controls%2Cvideo_bitrate_mode%3D1%2Cvideo_bitrate%3D4000000%2Cvideo_b_frames%3D0%22%20!%20%22video%2Fx-h264%2Cprofile%3Dbaseline%2Clevel%3D(string)4%22%20!%20h264parse%20!%20filesink%20location%3Dout.h264%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3EOn%20encoder%20firmware%20version%201.3.0%2C%20this%20results%20in%20a%20file%20size%20of%204980939%20bytes%20(~5MB)%2C%20vs%20on%201.4.5%20the%20result%20is%20only%20102994%20bytes%20(~0.1MB).%26nbsp%3B%3C%2FP%3E%3CP%3ECould%20you%20confirm%20that%20this%20is%20a%20known%20regression%20in%20the%20firmware%20and%20whether%20there%20is%20a%20workaround%20to%20use%20constant%20bitrate%3F%3C%2FP%3E%3CP%3ETested%20platform%20details%3A%3C%2FP%3E%3CUL%3E%3CLI%3Ekernel%26nbsp%3B6.6.52%20(digi%20embedded%20yocto)%3C%2FLI%3E%3CLI%3Egstreamer%26nbsp%3B1.24.7%3C%2FLI%3E%3C%2FUL%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2411718%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%208%20Family%20%7C%20i.MX%208QuadMax%20(8QM)%20%7C%208QuadPlus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E