cv431410
User
 Senior Boarder
| Posts: 10 |   |
|
C#, FFMpeg and Random Frame Access - 2008/02/12 20:50
Three questions:
(1) In the AvDn.AvDnFormatContext, we can read frames sequentially as follows:
i = 0; while (formatCtx.ReadFrame(packet) >= 0) {
int streamidx = packet.StreamIndex; if (streamidx == videoStream) { codecCtx.DecodeVideo(frame, packet, out frameFinished); if (frameFinished != 0) { frameRGB.Convert(Av.PIX_FMT_RGB24, frame, pixFmt, width, height);
} } }
That is good, but it reads one frame after another.
What can i do to:
(a) Go to a particular frame directly? (b) Read every M frames?
(2) AvDn.AvDnCodecContext, I read SampleRate and get 0, how do I get frame rate? Should I read frame rate elsewhere?
(3) Where do I read the total number of frames?
Thanks.
|