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: Germain Zouein
Subject: Re: [Ranger-users] Video files: thumbnail previews
Date: Mon, 29 Jul 2013 01:05:10 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

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`

Thanks

reply via email to

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