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.

samples: encode-decode workflow issues

fzeev
Beginner
692 Views
Hi, I have issue with encoding followed by decoding: the correct video file (h264/AVC format) was encoded using sample_encode, and encoding result was decoded by sample_decode using h264 codec. The decoded output was impossible to play (using VLC media player) or see its details in MediaInfo browser.
I tryed to repeate encoding-decoding workflow for the same file without audio codec, but result was the same(audio codec, was removed by ffmpeg with "failed for stream 0, codec copy" notice).
My workflow description:
|
1. Encoding for test.avi:
"sample_encode.exe h264 -i test.avi -o test.out -w 480 -h 272"
|
2. Decoding:
sample_decode.exe h264 -i test.out -o test_out.avi
|
Other questions:
I tryed to use HW optimization for sample_encode.exe (-hw option) but application returned errors, what may be the possible reason for that ? Does -sw option utilizes Sandy Bridge technology for transcoding?
|
My system has i7-2600 CPU and 2 graphic cards Intel (disable onboard card) and Nvidia GT430 - main graphic card.
|
May be you have had experience with SW/HW transcoding acceleration factors relative to any reference CPU/GPU system ?
|
Input video file details from MediaInfo:
===================================================================
General
Complete name : C:\\Program Files\\Intel\\Media SDK\\3.0.442.32245 Beta3\\samples\\_build\\x64\\Debug\\test.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 637 MiB
Duration : 2mn 10s
Overall bit rate : 41.0 Mbps
Writing library : VirtualDub build 32842/release
Video
ID : 0
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High 4:4:4 Predictive@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Codec ID : H264
Duration : 2mn 10s
Bit rate : 41.0 Mbps
Width : 480 pixels
Height : 270 pixels
Display aspect ratio : 16:9
Frame rate : 50.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 6.329
Stream size : 636 MiB (100%)
Writing library : x264 core 811799308Sep 8 2010
Encoding settings : cabac=1 / ref=1 / deblock=0:0:0 / analyse=0x3:0x113 / me=hex / subme=5 / psy=1 / psy_rd=0.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=0 / keyint=250 / keyint_min=1 / scenecut=40 / rc=cqp / mbtree=0 / qp=0
=================================================================
0 Kudos
1 Solution
IDZ_A_Intel
Employee
692 Views
Hi fzeev,

It seems you expect AVI container file to cointain raw data? This is not the case. Containers such as avi, mp4 or mpeg2 contain compressed media streams such as h.264 ES and AAC audio.

An example transcode (h.264 -> mpeg) pipeline would look something like this:
mp4 (containing h.264 ES) -> splitter(demuxer) -> h.264 ES -> Media SDK Decoder -> raw YUV -> Media SDK Encoder -> mpeg ES -> muxer -> mpeg container

Note that muxing and demuxing is out of scope of the Media SDK product.

The Media SDK developer guide have some information on how to extract ES from containers. You can also check out free tools such as YAMB for this purpose.

I cannot provide specific data on SW vs. HW performance. The results will vary wildly depending on type of video stream and platform configuration.

Regards,
Petter

View solution in original post

0 Kudos
6 Replies
IDZ_A_Intel
Employee
692 Views
Hi fzeev,

The way you are using the Media SDK samples it will unfortunately not work.
Media SDK operates on elementary streams (ES) and raw frame data. In your usage you are using media containers. Please refer to the Media SDK manual and Developer Guide for expanded details on how to use Media SDK and the samples.

You are feeding the encode sample an avi media container file. This will not work since the encoder requires RAW frame data input (encode sample expects input YUV data file). Decode sample expects ES input.

Some other notes:
- Common media players does not normally play back ES well
- You are using a discrete graphics card. By default this configuration will not work if you want to use HW acceleration. To make it work you will have to make some changes to the sample code and connect a secondary monitor associated with Intel processor graphics. There are more info on this in the manual.

Regards,
Petter
0 Kudos
fzeev
Beginner
692 Views
Thanks a lot for you response, I'm very new for Intel Media SDK, after I've finished to read Media Developers Guide and tryed to run examples. Probably the correct workflow to run examples (in my case) should be like:
AVI->YUV->sample_encode->ES->sample_decode->YUV->AVI
May be you can reference me how to convert avi to YUV and vice versa using Intel Media SDK (if that possible at all ...)
Other question, does sw option utilizes Sandy Bridge technology of CPU and how sw transcoding may be slow relative to hw one - I'm not looking for exact numbers any estimation will be good for me
0 Kudos
IDZ_A_Intel
Employee
693 Views
Hi fzeev,

It seems you expect AVI container file to cointain raw data? This is not the case. Containers such as avi, mp4 or mpeg2 contain compressed media streams such as h.264 ES and AAC audio.

An example transcode (h.264 -> mpeg) pipeline would look something like this:
mp4 (containing h.264 ES) -> splitter(demuxer) -> h.264 ES -> Media SDK Decoder -> raw YUV -> Media SDK Encoder -> mpeg ES -> muxer -> mpeg container

Note that muxing and demuxing is out of scope of the Media SDK product.

The Media SDK developer guide have some information on how to extract ES from containers. You can also check out free tools such as YAMB for this purpose.

I cannot provide specific data on SW vs. HW performance. The results will vary wildly depending on type of video stream and platform configuration.

Regards,
Petter
0 Kudos
fzeev
Beginner
692 Views
Hi Petter,
You are very patient for my questions and I'm very grateful to you for that !
Probably (I hope so) this's last question:
Intel Media SDK session may be initialized by HW or SW flag, when used HW flag, probably will be used graphic card capabilities for parallel computation. My question regarding to SW mode, does Media SDK function are optimized per CPU (for example if function is running on i7-2600 CPU, does will it utilize GPU capabilities of the CPU) or optimization is more universal, like to usage in SSE2/3 instructions for CPU, without to take into account capabilities of the current CPU ? Does optimization support older families of Intel CPUs?

Thanks in advance,
Ze'ev
0 Kudos
IDZ_A_Intel
Employee
692 Views
Hi Ze'ev,

If Media SDK is initialized with HW flag it means that Intel GPU fixed function HW will be used to accelerate codec. Note that HW acceleration is not available on all Intel platforms. This is where things may seem a bit confusing, since the recent Intel platforms such as the 2nd generation Intel core processors (also code named Sandy Bridge) have GPU and CPU integrated on the same silicon. When we refer to the GPU on such a platform we often refer to Intel Processor Graphics.

If Media SDK is initialized with SW flag it means that the codec workload will be executed on the CPU only. And yes, CPU codec execution is optimized for the specific CPU architecture.

And again, keep in mind that if you have a discrete graphics card installed, Media SDK HW acceleration will not work by default.

Regards,
Petter
0 Kudos
fzeev
Beginner
692 Views
Thanks,
Ze'ev
0 Kudos
Reply