How do I decode an MPEG2 stream in visual c++?

I am looking at MPEG2 streaming and decoding and am searching for a good start to accept a stream and draw it on the screen in visual c++, where should I start?
Who is Participating?
trinitrotolueneConnect With a Mentor Director - Software EngineeringCommented:
jkrConnect With a Mentor Commented:
Since you are on Windows, I'd suggest DirectX for that - you'll find a nice example at ("Preview and Record with MPEG2 Capture device"). Just replace the "Capture Device" in the graph with your MPEG stream and you are already pretty much done.
I'm not experienced on this subject, but... what about ffmpeg
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

alexatsearidgeAuthor Commented:
The example at ("Preview and Record with MPEG2 Capture device") I tried to compile it after installing the Windows SDK for Server 2003 (since I'm compiling my final app to work with Win XP) but I'm still getting linker errors with that sample, I think my Windows SDK or directshow version may be different than needed but the sample doesn't say what version is needed.

I'm looking further into directshow and using microsofts mpeg2 - demux but I never worked with makefiles so I'm still trying to compile them so I can try the samples that come with Windows SDK - the Directshow Samples - Filter Samples but they make it a little difficult to set up the environment - your includes and exe files in Options - C++ Directories need to be in a certain order that I'm still figuring out.


If you read into ffmpeg and do some research they say it is not designed for MSVC++ .net because MSVC++ does not follow the C99 standard and FFmpeg is designed to rely on it. The current project that I'm working on uses MSVC++ but if anyone else wants to try ffmpeg on windows with MinGW they talk about it here  but they also state that you have to do all your compiling still in a virtual box running linux.
alexatsearidgeConnect With a Mentor Author Commented:
We did not want to tie our code down to a Windows environment so we bought a license for Intel(R) Integrated Performance Primitives (IPP) which comes with an MPEG2 decoder/encoder and full sample code with easy to compile VS2005 c++ projects and solutions, anyone doing media decoding/encoding I would highly recommend this package - nice samples and well documented
alexatsearidgeAuthor Commented:
Solution is to use directshow which should work, in the end I went with Intel Integrated Performance Primitives which also works.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.