Log in

View Full Version : FFmpeg quick seek to start offset


beavemcgeave
26th November 2008, 11:46
Hi Guys,

I've been looking for info on how to get ffmpeg to quickly seek to the start position of a video i want to encode.

I know i can use the -ss option to start at a specific time but if i have an hour long video and i want just the last 5 minutes, ffmpeg will read each frame untill the 55th minute. This can take quite some time.

Is there anyway i can get it to just skip straight there?

I'm encoding from an mpeg2 ts.

hanfrunz
26th November 2008, 14:42
If you want to exactly seek to a given time in a mpeg stream you must analyse the stream (indexing) before. Try DGindex+Avisynth+ffmpeg (avisynth usage enabled build)

beavemcgeave
27th November 2008, 12:28
hmm ok. I was thinking of even modifying ffmpeg to use av_seek_frame but would i need to analyse the stream first still? Is there an api call for this?

The mpeg ts stream does have a time stamp (dvb-t recording). Could i choose this time stamp to skip to?