Video Thumbnails using ffmpeg

Posted by LenzM on Super User See other posts from Super User or by LenzM
Published on 2010-04-29T05:24:45Z Indexed on 2010/04/29 5:29 UTC
Read the original article Hit count: 402

Filed under:
|
|
|

I'm looking for a nice short easy way to create a series of thumbnails for any given video file. I'm almost there using ffmpeg, here's what I have:

ffmpeg -i /tmp/video.avi -r 1 -ss 60 -r 1 foo-%03d.jpeg`

The only problem is that this takes a shot every second and I'd like to make it every minute or so. I tried setting the -r value to 1/60 or .02 to no avail.

For reference, here's the old script I was using that only worked for some files:

#!/bin/bash
# grab a screenshot every 60 seconds
file=$1
orig_dir=`pwd`
mins=`exiftool "$file" | grep "Duration" | awk -F : '{print $2}' | grep --only-matching '[0-9]*'`
dir="$file-screenshots"
mkdir "$dir"
cd "$dir"
mplayer -vo png -vf screenshot -sstep 60 -frames $mins -ao null "../$file"
cd "$orig_dir"

This doesn't have to be on the command line, it's just that it always ends up being easiest.

© Super User or respective owner

Related posts about ffmpeg

  • how to install ffmpeg in cpanel

    as seen on Super User - Search for 'Super User'
    i'm using dedicated server(linux) so i need to install ffmpeg in cpanel so here ffmpeg i found in Main Software Install a Perl Module but i writing script in php so how can i install ffmpeg phpperl when i'am trying to install ffmpeg in perl module i get this response Checking C compiler… >>> More

  • FFMpeg-PHP Installation Error

    as seen on Server Fault - Search for 'Server Fault'
    While installing FFmpeg-PHP, I got this interesting error: /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function 'zim_ffmpeg_movie_getAudioStreamId': /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1051: error: 'CODEC_TYPE_AUDIO' undeclared (first use in this function) /usr/downloads/ffmpeg-php-0… >>> More

  • git problems installing stuff [closed]

    as seen on Super User - Search for 'Super User'
    root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~#… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    Hi, I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

Related posts about thumbnails