Theresa Arzadon-Labajo

Script to create jpg thumbnails from flv files using ffmpeg

Posted by Theresa Arzadon-Labajo (tarzadon) on Nov 28 2009
Tech Stuff >> Unix-Linux

Using instructions from Using ffmpeg to create jpg thumbnails from flv files,

I created a bash script that would take a filename from the command line, then output the file with a .jpg extension.

The command line that was given in the post didn't work for me:
ffmpeg -i video.flv -an -ss 00:00:03 -an -r 1 -vframes 1 -y %d.jpg

But, the one given in the comment by Philippe Maegerman did (-minus the .exe part):
ffmpeg.exe -i stream_1146848749371.flv -y -f singlejpeg -ss 0.001 -vframes 1 -an test.jpg

I just modified it to suit my needs.

This is what my script looks like:

#!/bin/bash
# ffmpeg2jpg - Takes an flv file and outputs a jpg thumbnail
OUTPUT_FILE=`basename $1 .flv`
ffmpeg -i $1 -y -ss 0.001 -vframes 1 -an $OUTPUT_FILE.jpg

Last changed: Feb 27 2020 at 4:14 PM

Back