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.

Recommended method of generating H264 input, and rendering YUV output from the sample_decode tutorial

Mike_D_1
Beginner
465 Views

I've been investigating multiple issues related to the Intel Media SDK sample H.264 encoder and decoder DirechtShow filters. For references, see https://software.intel.com/en-us/forums/topic/532362.

Since it was suggested in the comments to test the decoder and encoder separate from the direct show filters, I have started to look at the tutorial samples. In particular the sample_decode tutorial provided in the http://software.intel.com/sites/default/files/mediasdk-tutorials-0.0.3.zip package.

The tutorial expects an H.264 elementary stream but it is not clear the exact format that is expected (as far as I know there is no standard way of storing H.264 bitstream). After fiddling with multiple method of generating a suitable input stream I successfully extracted such a stream from an MP4 file I had previously recorded from the webcam. The method that worked was to use ffmpeg with the following set of paramters:

ffmpeg.exe -i input_file.mp4 -vcodec copy -vbsf h264_mp4toannexb -an -f h264 video_stream.h264

Nonetheless I'd like to know if there is a recommended method (perhaps easier) to generate the H.264 stream required by the sample.

Once I had a valid H.264 input stream I ran the sample_decode example on it to produce a decoded stream:

sample_decode.exe video_stream.h264 video_frames.yuv

This appears to have been successful, and it generated an output file that supposedly contains raw YUV frames.

How can I verify that these frames were correctly decoded (meaning that they correctly represent the original video)?

I've been searching for a method to render the YUV stream using DirectShow or some other method without success.

OS: Windows 7 x64
MFX: software mode
Processor: Intel Core i7 (first generation)

0 Kudos
1 Solution
Sravanthi_K_Intel
465 Views

"Nonetheless I'd like to know if there is a recommended method (perhaps easier) to generate the H.264 stream required by the sample." -> I have used YAMB software so far to extract streams from MP4 files, and it works great.

"How can I verify that these frames were correctly decoded (meaning that they correctly represent the original video)? " -> YUVPlayer is a very good utility for viewing YUV files. (http://www.yuvplayer.com/)

View solution in original post

0 Kudos
2 Replies
Sravanthi_K_Intel
466 Views

"Nonetheless I'd like to know if there is a recommended method (perhaps easier) to generate the H.264 stream required by the sample." -> I have used YAMB software so far to extract streams from MP4 files, and it works great.

"How can I verify that these frames were correctly decoded (meaning that they correctly represent the original video)? " -> YUVPlayer is a very good utility for viewing YUV files. (http://www.yuvplayer.com/)

0 Kudos
Mike_D_1
Beginner
465 Views

Thanks for pointing me towards both tools.

Using Yamb to extract the H264 stream is definitely a bit easier than manually typing the parameters for ffmpeg.

As far as the YUVPlayer, that did the trick and I was able to determine that the output format from sample_decode is YUV420.

As a side note, it turns out that the decoded frames look good which means that there is yet another problem with the sample Direct Show filters. The H.264 decoder filter produces several artifacts (solid green pathes) when decoding the source file but that is best left for a separate thread, after I've had some time to investigate more.

0 Kudos
Reply