[iMX8MP] How to debug VPU_EncEncodeFrame() = 2 : INVALID_PARAM

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[iMX8MP] How to debug VPU_EncEncodeFrame() = 2 : INVALID_PARAM

ソリューションへジャンプ
544件の閲覧回数
b_m
Contributor III

I am trying to encode via VPU wrapper as written in this manual, however VPU_EncEncodeFrame() is returning 2 : INVALID_PARAM, without any other error logs showing on the console.

1. Can anyone tell me how to debug this to know which parameter is causing this error?
2. Is VPU_EncEncodeFrame() 's parameter the only parameter that is faulty here, so I don't need to check parameters passed to previously called API's such as VPU_EncOpenSimp()?
3. Checking vpu_wrapper.c, I see that some logs are output via VPU_LOG() or VPU_ENC_LOG(), can this be enabled from the application side? And is it correct to assume that if it is enabled, the log is directed to the console?
4. Any sample codes that implements encoding via VPU wrapper, specifically for imx8mp?

Any replies would be highly appreciated!

0 件の賞賛
返信
1 解決策
413件の閲覧回数
b_m
Contributor III

Hi joanxie, thanks for the follow-up.

Turned out the problem was the 1st argument VpuEncHandle, created from VPU_EncOpenSimp(), was not passed properly to VPU_EncEncodeFrame().

We got too focused on the term "PARAM" of the error code, thought it pertained to VpuEncOpenParamSimp, and assumed a separate error code (3 : INVALID_HANDLE) would be set with regards to VpuEncHandle.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
512件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

what's your use case? did you download nxp yocto bsp? what source code do you refer to?

0 件の賞賛
返信
503件の閲覧回数
b_m
Contributor III

Hi, thanks for replying!

>what's your use case?
I am trying to make an application that would run on imx8mp evk, which encodes a single image file (believed to be of YUV420 format) into H264 format. 
Basically, I just want to see first how encoding works as I have no background on this.

This input image file is created via the following command:
gst-launch-1.0 filesrc location="raw.jpg"  ! jpegdec ! filesink location="image_file.yuv"

raw.jpg: JPEG file created on Paint (1920x1080)
image_file.yuv: my application's input file which I believe/hope is of YUV420 format

> did you download nxp yocto bsp? 
Yes, I am using yocto-real-time-edge bsp.

>what source code do you refer to?
None, I am only referring to the VPU reference manual, that's why I included that same question in my original post.

Parameters passed to VPU_EncOpenSimp and VPU_EncEncodeFrame are mostly set to automatic values (0 or -1), according to the manual.

Other parameters are based on the input image file, such as size.

0 件の賞賛
返信
427件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

sorry I missed this update somehow, I think you need add some extra plugins to support jpeg to yuv, you can try this command to display jpeg firstly, we tested this before

gst-launch-1.0 -v filesrc location=<output_image>.jpeg ! jpegdec ! imagefreeze ! videoconvert ! autovideosink

0 件の賞賛
返信
414件の閲覧回数
b_m
Contributor III

Hi joanxie, thanks for the follow-up.

Turned out the problem was the 1st argument VpuEncHandle, created from VPU_EncOpenSimp(), was not passed properly to VPU_EncEncodeFrame().

We got too focused on the term "PARAM" of the error code, thought it pertained to VpuEncOpenParamSimp, and assumed a separate error code (3 : INVALID_HANDLE) would be set with regards to VpuEncHandle.

0 件の賞賛
返信