How to seek to particular frame in elementary video stream?

288 Views Asked by At

We are trying a develop a media player and have gone through tutorials from dranger mentioned [Dranger tutorial for ffmpeg1. The api mentioned here talks about seeking and playing container formats.What we want is player for raw/elementary video streams(M2v in what we are using). The av_seek_frame does not work on these streams as there is no PTS or DTS value in elementary streams.

Any help regarding the seeking the elementary streams would be of great help,I have the timecode of the desired position to be seeked.

1

There are 1 best solutions below

0
On

Have you tried extracting the frame rate value from the elementary stream header and using that to seek? Given the frame rate and time offset you could calculate which frame corresponds to the needed time (of course if the encoder honours the frame rate value).