Hi,
The code below should seek to the middle of the file an output a JPEG. I have tested this and it does work. Somethings to be aware of are that the function for getting the FLV duration I got from this forum: http://flixforums.com/arch
Also the -ss command for ffmpeg moves the position in the file to the second that is passed. Some builds of ffmpeg seem to have an issue with -ss, but it wokred fine on mine so you will just have to try it and see.
Main Topics
Browse All Topics





by: glcumminsPosted on 2008-06-09 at 12:30:47ID: 21745898
To improve quality, try increasing the frame rate via the -r option:
pipermail/ ffmpeg-use r/2006-Aug ust/ 003884 .html (Note that the language is not PHP, but you should be able to get the general idea).
$output = exec ("ffmpeg -i source.ext -s qvga -r 24 -ab 128 -y output.flv");
or
$output = exec ("ffmpeg -i source.ext -s qvga -r 30 -ab 128 -y output.flv");
Below is a solution to finding the total number of frames in a file, which you could use to determine the middle frame:
http://lists.mplayerhq.hu/