On Mon, 14 Jul 2014 17:54:20 -0700 Michael Albanese <[email protected]> wrote:
> I'm currently messing around with the ffmpeg API, more specifically, I've > been looking at ffmpeg's filtering_video.c example + the updated dranger > tutorial02.c which rapidly pushes decoded video frames to an SDL instance. > > I'm trying to modify dranger's tutorial02 in order to playback frames at > the rate which they are meant to be played, I've tried the following: > > - (Close, but too slow / fast) Getting the FPS, sleeping calculated_delay - > processing time > - (Too fast) Delaying the video as shown in the filtering_video.c example > > I've been looking into how dranger was accomplishing it in tutorial05 > <http://dranger.com/ffmpeg/tutorial05.html>, he appears to be using the pts > / dts in order to calculate the delay, however the overridden > AVCodecContext get_buffer and release_buffer pointers seem to be > depreciated. > > Since the up to date version of his tutorial05 found here > <https://github.com/chelyaev/ffmpeg-tutorial> does not synchronize properly > either (comparing against ffplay)... is anyone willing to point me in the > right direction (or write an up to date tutorial on playing back video + > audio at the correct rates). IMO the only reliable way is to decode 1 frame in advance, and take the difference between the PTS values. Of course this doesn't work either if there is a PTS reset, but these are very rare. _______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
