Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to find the info about frames number in a MPEG file

1 view
Skip to first unread message

Alexan...@gmail.com

unread,
Apr 5, 2007, 1:40:51 AM4/5/07
to
Hi, gurus!
How to find the info about frames number in a MPEG file, for example,
I wanna find the last two frames in the MPEG file, how could I reach
my goal?

Michel Roujansky - DirectShow Consultant and Trainer

unread,
Apr 5, 2007, 3:44:05 AM4/5/07
to
On Apr 5, 7:40 am, "Alexander....@gmail.com" <Alexander....@gmail.com>
wrote:

After rendering your file, use IMediaSeeking->GetPositions on the
filtergraph to get the duration of the file (= the stop position).
Then compute the start time of the first frame you need based on the
total duration and total number of frames(=total duration divided by
frame duration).
Use IMediaSeeking->SetPositions to get to the required position.
(you cannot use TIME_FORMAT_FRAME because it is usually not supported
on the mpeg2 decompressor).

Alexan...@gmail.com

unread,
Apr 5, 2007, 11:17:32 PM4/5/07
to
On 4月5日, 下午3时44分, "Michel Roujansky - DirectShow Consultant and

Thanks, Now if the media type is MJPEP and I can seek the given frame,
but how could I get the data of the frame and write to anther file?

Michel Roujansky - DirectShow Consultant and Trainer

unread,
Apr 7, 2007, 7:16:42 AM4/7/07
to
On Apr 6, 5:17 am, "Alexander....@gmail.com" <Alexander....@gmail.com>
wrote:

> Thanks, Now if the media type is MJPEP and I can seek the given frame,

> but how could I get the data of the frame and write to anther file?- Hide quoted text -
>
> - Show quoted text -

Hi, there are two main techniques to get frame data :
1) use the sample gabber (or write a transform filter that does the
same).
You insert this filter in the graph, capture the sample and write it
to file.
2) use the dump filter (or modified version) to write to file the
frames that get played.
The choice is entirey yours...
Cheers,

0 new messages