I have written a program to dump out all frame numbers and associated pts/dts values and key-frame statuses. This works fine.
If I want to av_seek_frame back to a specific frame from the aforementioned dump, what timestamp value should the seek be based on? Is it the dts value or the pts value (neither of which gets me anywhere near the required frame)? Or is it the pts/dts minus the first pts/dts value in the file (which seems to get me close - but never spot on). When I seek, if I am seeking forward I use AVSEEK_FLAG_ANY, if I'm seeking backwards I use AVSEEK_FLAG_BACK | AVSEEK_FLAG_ANY. I know that the av_seek_frame can theoretically be used to locate ONLY KEY FRAMES (i.e. don't specify AVSEEK_FLAG_ANY) but in this mode, the returned packets may be more than one keyframe spacing away! I really want to be able to seek and get very close if not spot-on a particular frame in the file - but this seems impossible! Can anyone tell me how to compute a suitable seek value from a packet's pts/dts that will return me to a previously decoded frame? Gary Smart _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
