You also may want to consider pre-processing your videos, by transcoding them to ljpeg.
Once in ljpeg, when you call av_seek_frame(), you seek to that exact frame. For alternatives to ljpeg, with similar av_seek_frame() behavior, see libavformat/utils.c's is_intra_only() function. I use this technique for my VJ software. It allows me to video-scratch and instantly jump to arbitrary frames, since I can trust av_seek_frame(). It works quite well. -Chris On Thu, Oct 22, 2009 at 6:23 AM, Bogdan Coanda <[email protected]>wrote: > 1. I use google to search the mailing list > > 2. if by specific frames you mean you want to extract from frame 300 to > 350, > the easiest way is to simply parse the video from the beginning, until you > reach the desired frames. > > there is "av_seek_frame" in the library and it's quite fast but it's an > approximate jump (at least for the mpeg ts files I work with), and you > would > be able to jump "somewhere around" frame 300, but not knowing exactly were > you are. To counter this, I pre-parse the video to see where different > jumps > arrive at, so I can jump later at any exact frame: > > step 1: > parse the video frame-by-frame and remember for each frame it's pts/dts in > a > vector > > step 2: try to jump to different frames with av_seek_frame and compare the > pts/dts of the found frame with the table from step one to see where you > actually arrived at. you'll get a vector like this: > > jump to frame 100 -> arrived at frame 94 > jump to frame 200 -> arrived at frame 196 > etc. etc. > > 3. I guess you could insert your own decoder into the library to extract > the > info. > > Regards. > > On Thu, Oct 22, 2009 at 12:10 PM, Stefano Sabatini < > [email protected]> wrote: > > > On date Thursday 2009-10-22 16:43:32 +0800, S R encoded: > > > Hi > > > > > > I am learning to use ffmpeg for my research work. > > > > > > I have three questions: > > > > > > 1. Is there a way to search the libav-user list by topic or subject? I > > > cannot find one. > > > > Mailman archive interface is rather dumb, try this instead: > > http://dir.gmane.org/gmane.comp.video.ffmpeg.libav.user > > > > > 2. I am trying to extract some specific frames from a video file. Is > > there > > > any example code that tells how to do it. I already know how to get > > frames > > > from a video from the beginning, as I got an example code from the > ffmpeg > > > tutorial. > > > > Maybe the ffprobe code. > > > > > 3. Is there an example code that explains how to extract the motion > > vectors? > > > > I'm not sure libavcodec exports that information, for sure you can ask > > libavcodec to show them in the decoded image, check for example the > > -vismv option of ffplay. > > > > > Appreciate your help with the above. Thank you! > > > > Regards. > > _______________________________________________ > > libav-user mailing list > > [email protected] > > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > > > > > -- > Bogdan COANDA > > AIESEC Iasi > AIESEC in Romania > > Mobile: +40-724 013 068 > E-mail: [email protected] > Website: www.aieseciasi.ro > > > _____________________________________________________________________________ > AIESEC - The international platform for young people to discover and > develop > their potential > _______________________________________________ > libav-user mailing list > [email protected] > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
