|
From: | Joshua Landau |
Subject: | Re: [Ranger-users] Video files: thumbnail previews |
Date: | Sun, 28 Jul 2013 23:24:38 +0100 |
It only takes ~1s here.On 07/29/2013 12:24 AM, Joshua Landau wrote:
Scratch everything I said. I've no idea what I've changed, but it works now, if unreliably. I can only tell you that I had already set preview_videos and preview_images. What else changed is a mystery.
It's still slow to seek, but there's a faster way (!). Yes, I have beaten the Gods¹ and climbed mountains higher than the sky² and have made the most hackedly-hacky hack that probably I've ever done:
ffmpeg -i INPUT_FILE -frames 1 -vcodec copy -ss 10 -v quiet -y TEMPOARY_VIDEO.mkvffmpeg -i TEMPOARY_VIDEO.mkv -v quiet -frames 1 -y OUTPUT.png
Yes -- two passes. The problem is that ffmpeg seems to always want to seek slowly or something -- but can seek fast if you force it not to decode any frames. Hence you need to do the seeking *within* the video. Or something. I don't really know why it works. This takes about 1.1 seconds, whereas:
ffmpeg -itsoffset 10 -i INPUT_FILE -vframes 1 -y OUTPUT.png
takes around 10 to 11 seconds. So it's a 10x speed up (that's more like the peak speed-up, to be fair). I have no idea how robust this is, but it seems to work on the two files I've tried.
¹ Never happened² Also never happened
I think I'll use ffmpegthumbnailer (http://code.google.com/p/ffmpegthumbnailer/) instead of ffmpeg. It looks pretty neat, is (much) faster than what I'm currently doing, can seek to a percentage of time (e.g. 10% of the video). Other FMs use that (e.g. Thunar) so I guess it's rather reliable. Can you try that and let me know how fast it is?
Something like this (you can use `time` to time it if you want ): `ffmpegthumbnailer -i <path to video file> -o <output path> -s 0`
[Prev in Thread] | Current Thread | [Next in Thread] |