Is there a way to make FFmpeg seek faster to an end of file on a network share?

5

I'm using ffmpeg to generate image previews from flv videos. The OS is Debian 5 and it's the apt version of ffmpeg. The flv files are located on a NAS share that is mounted as NFS. Getting the thumbnails from the beggining of the flvs is pretty fast but is very slow when seeking above 10 minutes into the video. I call ffmpeg from python like so:

os.system('ffmpeg -ss "%d"  -i %s -an  -r 1 -vframes 1   -bufsize 1835k -s 360x288 -f image2 -vcodec mjpeg -y "%s"'%(offset_seconds, video_file_path,  image_path))

Is there a way to speed the seeking process towards the end of the flvs? What could cause it to be so slow?

I've tried the same thing on my local machine (Mac OS X snow leopard with ffmpeg compiled from source) and I can't feel any difference in speed when capturing images from the begging of the video and 50 minutes into the video.

Edit: The mentioned debian server has a faster hardware configuration than my local machine.

Vasil

Posted 2009-10-07T12:08:10.997

Reputation: 151

If you use some other software, e.g. vlc, to playback video at the 10 min mark? Would it make a difference in speed? You can use the --start-time option to jump to specific time. – some user – 2019-08-09T22:23:53.297

Answers

0

You've narrowed the problem down to the NFS mount. ffmpeg itself isn't changing its behavior 10 minutes into the input video -- if it did, you'd have noticed when you tried reading a video on local disk.

I bet that installing and running ffmpeg on the NFS server (so it's again local disk) would not show a slowdown 10 minutes in.

There may be some way to adjust the NFS configuration (caching?), but it's probably simpler to just copy the entire video to local disk and then have ffmpeg read that. It won't be slower: the data needs to be moved over anyways, because although ffmpeg needs only the pixels of one frame per second to make the thumbnails, it needs to read plenty more in between (keyframes) to reach and decode those few frames.

Camille Goudeseune

Posted 2009-10-07T12:08:10.997

Reputation: 1 361