Intel Media SDK tutorial: encode-decode check

Intel Media SDK tutorial: encode-decode check

I've been trying the examples in the Intel Media SDK tutorial:
http://software.intel.com/en-us/articles/intel-media-sdk-tutorial

However, I found that when trying to take a sample raw YUV4  video (such as "coastguard" from http://media.xiph.org/video/derf/) which plays correctly in VLC, encode it with simple_3_encode, and decode it with simple_2_decode (which should give me back a lossy version of the original YUV), the final video looks quite different in VLC.  See the attachments below.  Furthermore, MediaInfo can't read any metadata in the final output.

  • No changes to the source for simple_3_encode nor simple_2_decode were made other than changing the input resolution of simple_3_encode to match CIF format.
  • The same issue happens for the variants of simple_3_encode (and simple_2_decode) such as simple_3_decode - d3d.
  • The same issue happens for larger YUV4 videos such as 1920 x 1080 "pedestrian_area" from http://media.xiph.org/video/derf/y4m/pedestrian_area_1080p25.y4m
  • I also tried playing encoder's output file ".264" directly in VLC but it did not play at all.

What could be the problem?

AllegatoDimensione
Download good-input.png208.03 KB
Download bad-output.png74.78 KB
4 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Hi Richard,

I picked up the first raw YUV frame of the "coastguard" content from here,  http://www.cipr.rpi.edu/resource/sequences/sequences/sif/yuv/sif_yuv_coa... (the two first links are broken) and encoded it to H.264 using simple_3_encode project without issues. The YUV file is of resolution 352x288, so you have to change the inputWidth and inputHeight in the code.

I do not recommend using typical end user media players (such as VLC or WMP) to play back elementary streams(ES). Such players were developed with container decode (not ES) in focus and it will often fail to decode pure ES.

If you want to play back (render) pure ES check out Media SDK sample_decode sample or video tools such as Elecard StreamEye, FFmpeg and many others.

Elecard also have a nice YUV viewer tool whihc you can use to validate YUV content before feeding it into any encoder.

I do not believe the "pedestrian" content is of typical YUV type color space format since I do see some drifting shadows. You would likely have to convert color space first if you want to use this clip.

Regards,
Petter 

I had made the change to the resolution parameters for 352 x 288.  I have tried your suggestion of using ffmpeg.  However, when I extract the frames of the encoded h264 file (or view with ffplay), the result has a strange vertical line and the video seems to "scroll sideways" (see attachment).  The ffmpeg command I use is:

ffmpeg -i test.264 -vframes 300 out%d.png

or simply:

ffplay test.264

See attachment for examples.  Is there something I am missing?

Allegati: 

AllegatoDimensione
Download out1.png152.92 KB
Download out50.png154.86 KB
Download out100.png187.92 KB

Hi Richard,

I see nothing wrong with the coastguard YUV content. I suspect that in the process of merging the coastguard YUV files you may have introduced some additional padding, thus the scrolling issue.

I joined the first 12 yuv frames from the coastguard content into one yuv file and was able to encode into a proper stream.

I suggest you validate your YUV input files with YUV viewing tool before feeding it to an encoder.

Regards,
Petter 

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi