Link to home
Start Free TrialLog in
Avatar of bimalprakashsharma
bimalprakashsharma

asked on

Split MPEG movie to jpg and bmp formats

Hi,

I need to take an mpeg movie file and the c++ code will split it into jpg frames and save it to a folder. I need to do this using code so trying out a ready made software will not work for me.

Can someone help please.  
Avatar of YoungBonzi
YoungBonzi
Flag of United States of America image

This guy did it: http://www.codecomments.com/archive286-2005-1-374106.html
http://berniedev.tripod.com/berniedev_site/Index.htm (http://berniedev.tripod.com/berniedev_site/Download/Package/MpegLib.zip, http://berniedev.tripod.com/berniedev_site/Download/Package/SampleMPEG.zip & http://berniedev.tripod.com/berniedev_site/Download/Package/OptLib.zip)

----------

But if I had to do it from scratch, I would probably figure out how to play mpegs in DirectX (DirectShow or D3D). THen I would learn how to pause it. Then how to grab a frame to the clipboard or to a file, and manipulate the file/object into a jpeg. Then I'd go about automating that until the end of the mpeg.

I think that method may be easier for me than trying to understand someone else's code.

But good luck!
ASKER CERTIFIED SOLUTION
Avatar of NicoLaan
NicoLaan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bimalprakashsharma
bimalprakashsharma

ASKER

NicoLaan,

Your first option using the mplayer is interesting. But how do I run the command line util from c++?

Can you please post some sample code?
Sorry, no c++ expert. Also depends what c++ I think (msvc 6.0, or from visual studio 2005, Borland, djgpp, GNU, other?)
I know all languages have some fairly easy way to do this.

Please search with google something like:
c++ execute dos command "your C++ flavour name"

For a test you can first execute notepad that's more easy.
Then test with parameters, i.e. notepad Test.txt
And then you're ready for the mplayer test.
Glad I could help.
Thanks for the points.