Hi all,
I am evaluating the AM62A h264 encoding capabilities. I downloaded the latest Linux image from TI's website (09.00.01.03 - tisdk-edgeai-image-am62axx-evm.wic.xz) and began compressing some file to see what parameters can give the bitrate and the quality I am looking for.
Inspired by the following example provided on the documentation:
gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video2 ! video/x-bayer,width=1920,height=1080,format=bggr ! tiovxisp sensor-name=SENSOR_SONY_IMX219_RPI dcc-isp-file=/opt/imaging/imx219/dcc_viss.bin sink_0::dcc-2a-file=/opt/imaging/imx219/dcc_2a.bin sink_0::device=/dev/v4l-subdev2 ! video/x-raw,format=NV12 ! v4l2h264enc output-io-mode=dmabuf-import extra-controls="controls,h264_i_frame_period=60" ! rtph264pay ! udpsink port=5000 host=<ip_address>
I wrote the following pipeline to test if extra-controls had an effect on the output:
gst-launch-1.0 filesrc location=uncompressed_video.avi ! decodebin ! ticolorconvert ! video/x-raw, format=NV12 ! v4l2h264enc extra-controls="controls,h264_i_frame_period=10" ! avimux ! filesink location=compressed-i-10.avi
gst-launch-1.0 filesrc location=uncompressed_video.avi ! decodebin ! ticolorconvert ! video/x-raw, format=NV12 ! v4l2h264enc extra-controls="controls,h264_i_frame_period=5" ! avimux ! filesink location=compressed-i-5.avi
Indeed compressed-i-10.avi has 1 I frame for 9 P frames and compressed-i-5.avi has 1 I frame for 4 P frames.
I listed all the extra-controls available using
$v4l2-ctl --device /dev/video1 --all
Found parameters I wanted to play with:
- h264_profile
- h264_level
- video_bitrate
And whatever value I choose I always end up with a very compressed video (1 Mbps with all i-frame, whatever bitrate I set), the profile and the level won't change unless I add "video/h-264, profile=(string)high" before muxing the video.
Does anyone has a similar experience ? I don't have a MIPI camera at hand but could it be because it's not a live video source ?
Also I am using gst-launch, would it change something if I was generating my pipeline with the c++ library of gstreamer? I have tried many parameters combination but it seems the video file never gets any larger than the one using h264_i_frame_period=1.
Previously I had a similar experience with a NXP card, it was resolved by using the other hardware accelerated plugin provided by NXP instead of the standard v4l2h264enc. The TI documentation seems to indicate the only way to use hardware acceleration for h264 encoding is via v4l2h264enc, am I mistaken?
Any information is welcome!