I am trying to write a method that will provide the next frame and timestamp of the presentation when requested. The code currently looks something like this:
while( getNextFrame(image, pts) )
{
drawImage(currentImage);
sleep(pts);
currentImage = image;
}
I have been doing Dranger tutorials until this point, but have stalled on reliably getting PTS values for frames ( http://www.dranger.com/ffmpeg/tutorial05.html ). The returned PTS values are always 0.
It is also get_buffer()deprecated, so now I use the method get_buffer2()to set the global pts value. However, the method is release_bufferalso deprecated, and I cannot find a replacement for it. This makes me believe that the method described in textbooks may not be the best way to solve this problem.
In short, using updated ffmpeg, is the best way to capture frame frame values reliably?
karl_ source
share