Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Split MPEG movie to jpg and bmp formats

Posted on 2006-05-29
5
Medium Priority
?
474 Views
Last Modified: 2012-08-13
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.  
0
Comment
Question by:bimalprakashsharma
  • 3
5 Comments
 
LVL 8

Expert Comment

by:YoungBonzi
ID: 16782773
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!
0
 
LVL 4

Accepted Solution

by:
NicoLaan earned 750 total points
ID: 16783235
Would using a command line util do the trick for you?
mplayer / mencoder can do this using command line paramaters so you can still call it from code.
Examples found in help and internet, not tested by me:
mplayer video.nut −vo gif89a:15.0:test.gif
mplayer -frames 1 -vo jpeg outdir=/tmp:quality=75 path/to/movie.mov

trying to create your own mpeg player / ripper sounds like a hell of a job.
As an alternative, you could look at the source code and cooperate it in your software.
Check the license details for that.

http://www.mplayerhq.hu/design7/news.html

MPlayer is available under the GNU General Public License v2.
http://www.gnu.org/licenses/gpl.txt
0
 
LVL 1

Author Comment

by:bimalprakashsharma
ID: 16786138
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?
0
 
LVL 4

Expert Comment

by:NicoLaan
ID: 16794049
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.
0
 
LVL 4

Expert Comment

by:NicoLaan
ID: 16805900
Glad I could help.
Thanks for the points.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Loops Section Overview

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question