cv431410
User

Senior Boarder
Posts: 10
graphgraph
 
Click here to see the profile of this user
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.
  | | No public write access. Please register.
Daniel
Admin

Admin
Posts: 44
graph
 
Click here to see the profile of this user
Re:C#, FFMpeg and Random Frame Access - 2008/02/16 21:12 I don't have good answers for your questions.

I started to work on a newer version of the AvDn library and I didn't go very far (this would have included some of the functionalities you're looking for).

The reason I lost interest in this stuff is we'll never be able to "debug" ffmpeg on Windows with VC++.

So for my need, I usually work from ffdshow (as a Directshow filter) and use it as any other DS filter (i.e. standard Directshow programming).

If there is an interest, I wouldn't mind turning the library into an open-source project on SourceForge.
  | | No public write access. Please register.
cv431410
User

Senior Boarder
Posts: 10
graphgraph
 
Click here to see the profile of this user
Re:C#, FFMpeg and Random Frame Access - 2008/02/18 16:24 Where can I find out more about your ffdshow? In particular, does it support *.flv (youtube video file)?
  | | No public write access. Please register.
Daniel
Admin

Admin
Posts: 44
graph
 
Click here to see the profile of this user
Re:C#, FFMpeg and Random Frame Access - 2008/02/19 21:54 ffdshow can be found here.

It can certainly decode the older versions of the streams in a flv file, not sure about the newer version.
  | | No public write access. Please register.
cv431410
User

Senior Boarder
Posts: 10
graphgraph
 
Click here to see the profile of this user
Re:C#, FFMpeg and Random Frame Access - 2008/02/20 17:16 Thanks, I will try.
  | | No public write access. Please register.
Joomla Template by Joomlashack
Joomla Templates by JoomlaShack Joomla Templates by Compass Design