Vpuenc_h264 maximum encoder size

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

Vpuenc_h264 maximum encoder size

2,213 Views
mauricio_monter
Contributor I

I've had a real tough time trying to use the vpuenc_h264 with an image bigger than 1920x1080 in the imx8m mini, the reference manual says that the VPU can work with a maximum size of 4080x4080 and if we use the encoder for h264 it could work for 60fps at1920x1080.


For that reason, I try to change the maximum size of the encoder in the gstvpuenc code to be grater than 1920x1080 but it is not working correctly when I run the following pipeline:

GST_DEBUG=3 gst-launch-1.0 videotestsrc ! "video/x-raw, format=(string)NV12, width=(int)1928, height=(int)1080,
framerate=(fraction)10/1" ! vpuenc_h264 ! h264parse ! mpegtsmux name=mux ! queue !
filesink location=/tmp/test1280.ts enable-last-sample=false sync=false async=false

I get the following error:

OMX H264 ! HantroHwEncOmx_encoder_create_h264 H264EncInit failed! (-3) openmax_il/source/encoder/encoder_h264.c:772
0:00:00.093342500 3265 0x391a6850 ERROR
 vpuenc gstvpuenc.c:774:gst_vpu_enc_open_vpu:<vpuenc_h264-0> opening new VPU handle failed: failure
0:00:00.093379375 3265 0x391a6850 ERROR
 vpuenc gstvpuenc.c:947:gst_vpu_enc_handle_frame:<vpuenc_h264-0> gst_vpu_enc_open_vpu failed.

And I didn't find how to solve that error in the imx-vpuwrap or in the libgstvpu. So I want to ask If it is possible to encode a bigger frame using a lower framerate?

I also include the image of the VPU aspects.

encoder.PNG

0 Kudos
2 Replies

1,951 Views
pete_sensoray
Contributor II

I'm seeing the same error when trying to use a fractional framerate, such as 59.94 and 29.97 commonly used in video cameras.  It seems the encoder will only accept fractional framerates that are a multiple of 0.5.

GST_DEBUG=3 gst-launch-1.0 videotestsrc ! "video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, \
framerate=(fraction)59940/1000" ! vpuenc_h264 ! h264parse ! mpegtsmux name=mux ! queue ! \
filesink location=/tmp/test1280.ts enable-last-sample=false sync=false async=false

Error message:

OMX H264 ! HantroHwEncOmx_encoder_create_h264 H264EncInit failed! (-3) openmax_il/source/encoder/encoder_h264.c:773
0:00:00.117026000   937 0xaaaacba0c590 ERROR                 vpuenc gstvpuenc.c:861:gst_vpu_enc_open_vpu:<vpuenc_h264-0> opening new VPU handle failed: failure
0:00:00.117061375   937 0xaaaacba0c590 ERROR                 vpuenc gstvpuenc.c:1045:gst_vpu_enc_handle_frame:<vpuenc_h264-0> gst_vpu_enc_open_vpu failed.

Please let me know if I should create a new topic for this.

0 Kudos

2,152 Views
joanxie
NXP TechSupport
NXP TechSupport

I'm not sure if this is your typo or not, try to change 1928 in your command to 1920, I can use this command successfully in my board with "width=(int)1920"

0 Kudos