Log in

View Full Version : jpg extract with ffmpeg


PsyDonia
13th January 2011, 08:19
hello I use ffmpeg to extract i image from a video it works but it take some time.
I use this line
ffmpeg.exe -i Path\Video.avi -r 1 -t 1 -ss 00:01:45 Path\image.jpg

It goes thou all frames until it finds the one at the point I specify.
so if I specify like 00:30:00 it takes forever to just make one image.
is mencoder faster or can I use any other lcommands with ffmpeg to do it faster.

smok3
13th January 2011, 09:11
i'am using mtn on win and linux;
http://moviethumbnail.sourceforge.net/

example.bat (tries with two different parameters, 3rd time is error, then uses nconvert for further processing)

::echo off

title %1
echo.
echo %~n1%~x1 1st try
t:\utility\movie_thumbs\mtn\mtn.exe -i -c 1 -r 1 -t -P -o %~x1.jpg %1
:: next line assumes that width > height
t:\utility\movie_thumbs\nconvert\nconvert.exe -out jpeg -ratio -resize 0 100 -canvas 100 100 center %1.jpg


if not exist %1.jpg (
echo %~n1%~x1 2nd try
t:\utility\movie_thumbs\mtn\mtn.exe -i -c 1 -r 1 -t -P -Z -o %~x1.jpg %1
:: next line assumes that width > height
t:\utility\movie_thumbs\nconvert\nconvert.exe -out jpeg -ratio -resize 0 100 -canvas 100 100 center %1.jpg
)


if not exist %1.jpg (
echo %1 > %~f1.error
)

usage:

example.bat file.mp4
should return 100x100 px thumb with a name of file.mp4.jpg.

J_Darnley
13th January 2011, 11:46
ffmpeg.exe -i Path\Video.avi -r 1 -t 1 -ss 00:01:45 Path\image.jpg

Put -ss before -i