Log in

View Full Version : Frame count of MPEG2 file


laura_glow
19th October 2004, 19:30
Hi, I need to count the number of frames in a MPEG2 file generated with CCE Basic, and to extract a(any) frame into a bmp file too.

Is there any command line or source code available for this? Anything in c++ would be great!

I've read about ParseD2V but im not quite sure of what a .d2v file is.

I have read about DVD2AVI, but im confused about the versions, and features of this soft. (can't find a clear documentation and list of versions, wouldn't it be a great idea creating a DVD2AVI project in sourceforge.net?? :) )

Thanks a lot!
Laura

diehardii
19th October 2004, 22:26
Hi,

To count the number of frames programatically, you will have to look at the MPEG2 documentation (www.neuron2.net). Each different type of frame should have a specific header and you can count them. As for grabbing a sample, you will have to use DirectShow. You will need to render the file and you can use the SampleGrabber Filter (there is documentation at MSDN). It will also help if you turn off DXVA on your decoder and use the null renderer. Otherwise you will be reading off of the video memory which will be very, very slow. If you are unfamiliar with directshow, you can either buy the Mark Pesce DShow book, or you can download the SDK. Preferable both. There are some very good samples as to how to use the SampleGrabber filter. Good luck.

~Steve

Sirber
19th October 2004, 23:10
Ask Marcel (RealHandu author) about his fileinfo unit for Delphi. It works great :)