Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

Intel Media SDK tutorial: encode-decode check

richard_s_2
Beginner
909 Views

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?

0 Kudos
3 Replies
Petter_L_Intel
Employee
909 Views

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_coastguard.tgz (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 

0 Kudos
richard_s_2
Beginner
909 Views

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?

0 Kudos
Petter_L_Intel
Employee
909 Views

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 

0 Kudos
Reply