Sample application for encoding using VPU

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

Sample application for encoding using VPU

Jump to solution
1,050 Views
dhavalvadhar
Contributor IV

Hi,

I am trying to develop a sample application to encode 720x480 raw YUV video to H.264. That raw video is in UYVY format. So before developing one of my own encoding application I tried to encode this raw video using 'mxc_vpu_test' application. For that I used following command:

$ ./mxc_vpu_test.out -E "-i capturedata.yuv -o encodedata.h264 -f 2 -c 60 -w 720 -h 480"

This has generate the encodedata.h264 file. But when I played it on VLC player, the video was corrupted (see following snapshot).

corrupt_encoded_video_snapshot.jpg

Am I doing something wrong?

Thanks,

Dhaval

Labels (1)
Tags (2)
0 Kudos
1 Solution
708 Views
dhavalvadhar
Contributor IV

Hi Igorpadykov,

Thanks for your quick reply. No, it was not a header problem. But it was the problem of the input RAW file YUV format. It was expecting YUV420 and I was giving YUV422 as an input. After giving YUV420 as input file encoder works fine and the output file played perfectly with VLC media player.

Thanks,
Dhaval

View solution in original post

0 Kudos
2 Replies
708 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dhaval

seems it is the same as below

H.264 encoder header problem

If one needs that file was played by all video players, it is necessary

to use gstreamer. Difference between gstreamer and unit test is that file created

with gstreamer has header while file encoded by the mxc_vpu_test.out is "raw" file

which  doesn't contain header file.

To play file created with mxc_vpu_test.out, its "raw" file should be converted

to the .mp4 format first. Some special tools such as, for example the following one:

http://www.rarewares.org/mp4.html reviewed below

MP4 FAQ [Archive] - Doom9's Forum

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
709 Views
dhavalvadhar
Contributor IV

Hi Igorpadykov,

Thanks for your quick reply. No, it was not a header problem. But it was the problem of the input RAW file YUV format. It was expecting YUV420 and I was giving YUV422 as an input. After giving YUV420 as input file encoder works fine and the output file played perfectly with VLC media player.

Thanks,
Dhaval

0 Kudos