On Fri 02 May 2008 13:20, "Thomas Richards" <[EMAIL PROTECTED]> writes:
> Hi Everyone, > > > Thanks for your replies! > > I now have a first-pass solution working. Basically I iterate over the > entire file, and count the number of times I get STATE_PICTURE from the > mpeg2_parse function. > > This works, but it's horribly slow. A 24 minute clip (400 MB on disk) > takes over a minute to parse (84 seconds). Does it help if you execute 'mpeg_skip(decoder, 1);' ? > However, I notice that when I open the file in a media player (VLC for > example), it displays the duration instantly. Maybe that does some educated quess from bitrate of first sequence header, or from file size, or it seeks to the end of file and check the time last GOP header contains. > I was hoping someone here would know a few tricks to speed up this > performance. One thing I have thought of is increasing the size of my > memory buffer from 4KB to some larger value, but it doesn't seem to help > that much (using 8KB reduces the time from 84 to 81 seconds). > > Is there something I'm missing? I can't help but feel that my algorithm > is horribly naïve - there must be a better way to do this. Is this the > best performance I can reasonably expect? My http://www.iki.fi/too/sw/m2vmp2cut/mpeg2info.c, which just scanned 2,3Gib m2v file in around 80 seconds on a 2Ghz Intel Pentium M processor (well, the execution was disk access bound, 'top' show 10% CPU usage). That tool is (currenty) somewhat dummy, it can scan m2v elementary streams OK, but there is things that are not done for other kind of mpeg2 video files (work-in-progress, but sloooowly). > > > Thanks again! > > -- > Thomi Richards > Programmer > Tomi ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Libmpeg2-devel mailing list Libmpeg2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmpeg2-devel