On Monday 21 August 2006 09:33, Dan A. Dickey wrote:
> On Sunday 20 August 2006 01:38, Bernhard Praschinger wrote:
> > Hallo
> >
> > > I'm new to this list and to mjpeg.
> > > I was wondering if there is an easy to to feed an mpeg2
> > > video into one or more of the tools and extract jpg's to
> > > create a storyboard?
> >
> > When you decode the mpeg to mjpeg how do you do that ?
>
> I've been trying to use mpeg2decode for that.
> All it seems to do however is output to individual files - not stdout.
>
> > When you use ppmtoy4m I think the -n option would be also worth looking.
> >
> > BTW: Lavrec has the time-lapse mode where it records only very n'th
> > frame.
>
> I'm not recording, I'm just using a test mpeg file at the moment.
>
> > > I looked through the MJPEG Howto, but didn't see anything
> > > exactly like that.  What I found was 'lavtrans' that can extract
> > > all the frames, or a specific one.  What I'm thinking is that it'd
> > > be nice to grab say every thousandth or ten thousandth frame
> > > and put that into a jpg.  Perhaps it's simply a matter of
> > > calling lavtrans in a loop with different -i settings?  If I extract
> > > the 100 thousandth frame, does it do this by seeking to that
> > > frame instead of reading up to and tossing the first 99999 frames?
> >
> > lavtrans is very quick. It does not need to decode all the frames
> > before. To come to frame 10000. Using lavtrans would be a possible
> > solution.
>
> lavtrans doesn't understand the mpeg input file.
> And it also looks like I'd need to execute lavtrans in some sort of loop.
>
> What I did finally come up with, in case anyone is intereseted
> is to my mind - a hack.
> I'm using mpeg2decode to dump all the frames in PPM format
> to a temporary directory.  Then I determine from those frames
> which ones I want for my storyboard (atm - simply count them
> all and divide by how many I want and add those to my "list").
> And then cat them all into pampick (given my list as an argument),
> which pipes to pamsplit.  Then, run pnmtojpeg individually on each
> of the output files from pamsplit.  This is not pretty, a hack like I
> said.  It uses a tempory directory and duplicates the mpeg file
> as individual frames in that directory.  Double the disk storage
> in effect just to create a storyboard of jpeg's.
>
> What I'd really like is for mpeg2decode to do most of this
> given an option.  Something like "-n  integer   Number of
> frames to extract" or something similar.  Then, instead of
> actually outputting all the frames, just output the N key frames
> that I asked for.  Say, frame 0, 16, 32, 48, 64, etc...
> If there was an easy way to determine how many frame were
> in the mpeg, I could easily compute what N should be
> depending on how many frames I wanted in my storyboard.
> The test mpeg I'm using has 201 frames and I've been using
> 12 jpegs in a storyboard so what I need are frames
> 0 16 32 48 64 80 96 112 128 144 160 and 176 for this
> particular test mpeg.
>
> What'd I'd like to be able to do is be able to give mpeg2decode
> an option (n) and have it output the chosen frames to files.
> I can live with the PPM output and do the conversion to what
> I actually want I guess - but at the moment, it'd be nice if one
> of the output types was jpeg's.  :)
>
> Alternatively, if mpeg2decode wrote to stdout... I could work
> with that as well.  This is probably the easier change, but I
> do notice that mpeg2decode is kind of chatty - so that would
> need to be fixed as well so the stream wouldn't be messed up.
>
> If I get around to making either of these changes to mpeg2decode, I'll
> certainly let you all know.  If someone else does it first, I'd like
> to hear about it...
>
> Or, if someone has some other suggestion, I'd *really* like to
> hear that.  :)

What I have now finally ended up with is a little script that
uses ffmpeg to do my conversion.  ffmpeg will decode the mpeg
file and write jpeg's.  Then I delete the jpeg's that I do not want.
What is left is the storyboard.
Not the best solution as it still uses a load of disk space that
gets promptly thrown away, but better than using mpeg2decode
and then using cat | pampick | pamsplit and then using
pnmtojpeg on what is left.  And about 3 times faster as well.

Also - BTW - I'm sorry to be cluttering up this list with stuff
that is totally unrelated to mjpegtools.  I think I just realized
a while back that mjpegtools doesn't really have much to do
with mpeg2decode which comes from mpeg.org.

Anyways, have a great day and keep up the good work!
        -Dan

-- 
Dan A. Dickey
[EMAIL PROTECTED]

SAVVIS
Transforming Information Technology

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to