[Ffmpeg-devel] [Ffmpeg-devel-old] how to get the previous frame

Thomas Koninckx Thomas.Koninckx
Tue Apr 26 19:28:45 CEST 2005


On Tue, 2005-04-26 at 11:38 +0200, Claude Joseph-Angelique wrote:
> Hi,
> I'm trying to make a backward frame-by-frame on a video stream. But 
> av_read_frame() works sequencialy. How must I use av_seek_frame to get 
> the last frame without image degradation.
I needed to do the same a while ago. What I did --but it might be that
there is a much better solution-- is to make a small jump backward
(av_seek_frame current pts-1 sec), and then read frames until I'm back
at the current pts. I store always 2 frames in a small buffer. This way
I always got the previous frame, undistorted also if it is not a key
frame.
If somebody has a better solution.

Regards,
Thomas





More information about the ffmpeg-devel mailing list