0

I would like to find simple lib for my C++ project which can start thread with video and audio decoding and I can grab some frames? I try to explain my expectations about lib API and behavior in sample code:

player = new Player("video.avi");
player->Play();   // lib start video decoding into internal hidden buffer 
                  // and audio decoder start play sound from video file
.....
buffer = new ....
player->SyncCopyCurrentFrameIntoBuffer(buffer);   // copy last decoded frame into buffer
....
play->Pause();    // lib freeze video and audio decoding

May be somebody can recommend me something? (for Win)

Vie
  • 823
  • 1
  • 10
  • 18

2 Answers2

1

DirectShow is an MS technology that allows you to create a media pipeline consisting of a bunch of filters (such as sources, encoders, decoders, color converters, renderers, etc). In DirectShow you could create a graph that looks something like the following

Video source -> Sample grabber filter -> Video renderer

You can then play, and pause the graph. The sample grabber filter allows you to configure a callback which gets triggered as each sample goes through the media pipeline.

Be aware that DirectShow is not the easiest framework to learn. However the task that you want to accomplish is very easily do-able once you have the hang of it. DirectShow requires good knowledge of C++ and some COM (explained in the MSDN documentation). Main support is via the MSDN documentatio, which is quite extensive and the MS DirectShow forum.

Ralf
  • 9,405
  • 2
  • 28
  • 46
0

Maybe you'd like to have a look at libavcodec (or more generally, the ffmpeg package)? More info on http://ffmpeg.org

cbr
  • 1