ranger-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ranger-users] Video files: thumbnail previews


From: Joshua Landau
Subject: Re: [Ranger-users] Video files: thumbnail previews
Date: Sun, 28 Jul 2013 23:24:38 +0100

On 28 July 2013 23:05, Germain Zouein <address@hidden> wrote:
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.mkv
ffmpeg -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
It only takes ~1s here.

:(
 
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`

+1

It's a *touch* faster, which makes sense as it's just a less-hacky way of doing the same thing. That's especially good, though, as it defaults to 10% of the way in. It's another (optional) dependency, though.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]