4,391 Posts served
10,712 Conversations started
- Academic

- Android

- Art, Music, & Animation

- Embedded Computing

- Events

- Game Development

- Graphics & Media

- Intel SW Partner Program

- Intel® AppUp Developer Program

- Manageability & Security

- Mobility

- Open Source

- Parallel Programming

- Performance and Optimization

- Power Efficiency

- Site News & Announcements

- Software Tools

- Association for Computing Machinery TechNews (ACM)
- Go Parallel! (Dr. Dobbs)
- HPCwire (Tabor Communications, Inc.)
- insideHPC (John West)
- Joe Duffy's Weblog (Microsoft)
- Microsoft Parallel Programming Development Center (Microsoft Germany)
- MultiCoreInfo.com
- scalability.org (Scalable Informatics)
- Software Dev Blog (Intel Germany)
- Soft Talk Blog (Intel United Kingdom)
- The Moth (Microsoft)
Using the Media SDK - Simple DirectShow Trancoding
By Eric Sardella (Intel) (14 posts) on March 8, 2010 at 2:33 pm
Calling all developers working with media technologies! If you haven’t already, download and learn Intel’s Media SDK 1.5. Its easier then DXVA code and using it ensures you are forward compatible with future Intel hardware. Check it out.. Download it here.
Need a quick way to transcode a clip? Use the Media SDK’s DirectShow filters to build a solution using the Windows SDK tool GraphEdit. GraphEdit is a visual way to connect chains of DirectShow filters together to perform a media task. A series of connected filters comprises a “filter graph”. This tool can be found in the "bin" directory of the Windows SDK - version 6 or 7.
The following filter graph transcodes a MP4 file that I had downloaded off the internet into a MPEG2 that I can burn on a DVD. The process of transcoding is described below.
The file “Marty_ear_Training.mp4” (a guitar lesson I am learning) is read off the disk by a file “source” filter, and then sent downstream to the next filter in the chain. At this point, both the video and audio data are mixed together. The next filter in the chain is the Intel® Media SDK MP4 splitter filter. It’s this filter’s job to separate the audio and video data, and pass each on its own path. This MP4 file was encoded with AAC audio, which needs to be decoded. The Intel Media SDK AAC decoder handles this job. When it’s completed, a wave formatted audio stream is the output. On the video side, the Intel Media SDK h2.64 decoder accepts an h.264 compressed video stream, and outputs an uncompressed video surface. At this point, my guitar lesson has been decoded and can be rendered on the screen.
But this blog is about transcoding, so the output of the decoding process needs to become the input of the encoding process. Fortunately, it’s just a matter of connecting the right filters to do the job. I want my resulting MPEG2 file to have a MP3 video stream, so I send the output of the AAC decode into the MP3 Encode. I also want the video to be MPEG2, so I send the output of the h264 decode right into the encoder for MP2. The encoders work their magic and I have two streams of data that need to be combined into a single file. So, I plug in the Intel Media SDK MPEG-2 Muxer to combine the streams. The final filter is just a file writer which puts my new MPEG2 movie on the disk.
There are many different applications to play back a MPEG2 file, but for the sake of completeness let’s look at the playback graph for our new transcoded file in GraphEdit.
Again, the file is read from the disk. Then the audio and video substreams are spilt and decoded. Finally, instead of doing a trancode we send the output to the screen and speakers. The Video Render and Direct Sound Device filters are used to playback the clip, they are provided by DirectShow.
I encourage you to check out the Intel Media SDK and the DirectShow samples! The source code for the Intel Media SDK H.264 Decode, and Intel Media SDK MPEG2 Encoder are provided with the SDK, and the remaining SDK filters are distributed “as is” with feedback welcomed. Becoming familiar with DirectShow, Filters, and graphs will set the stage to delve deeper into the inner workings of the Intel Media SDK.
In the next blog, we will dig deeper into those encode and decode filters, and I’ll start to go over how they use Intel’s graphics hardware to accelerate the job they do. Comments, and recommendations always welcome.
Thanks
Categories: Graphics & Media, Uncategorized
For more complete information about compiler optimizations, see our Optimization Notice.
Comments (1)
Trackbacks (1)
- Brian C. Becker » Intel Quick Sync Hardware Encoding
November 7, 2011 10:16 PM PST




Tex
But how can one render into a D3D texture ?