Link to home
Start Free TrialLog in
Avatar of jwatsonPICTS
jwatsonPICTS

asked on

FFMPEG Quality & Thumbnail

Hi Guys,

I have a 2 part question.

#1. I have a script that works fine to convert uploaded video to an flv file using ffmpeg but the quality isn't great. I have tried increasing the bitrate from the default of 200kb/s to 700kb/s which seems to make the converted video much worse. What options should i use to get a better quality video output?

Here is the line of code im using:
$output = exec ("ffmpeg -i source.ext -s qvga -ab 128 -y output.flv);

#2. I have another line of code that then creates a thumbnail from the converted video but what i would like is the code to take a thumbnail from the central location of the video rather than just the start. How would i do that without knowing the length of the video to divide it?

Here is the current thumbnail code:
$output2 = exec ("ffmpeg -y -i output.flv -r 3.0 -sameq -f image2 -an output.jpg");

Thanks.
Avatar of glcummins
glcummins
Flag of United States of America image

To improve quality, try increasing the frame rate via the -r option:

 $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/pipermail/ffmpeg-user/2006-August/003884.html (Note that the language is not PHP, but you should be able to get the general idea).
ASKER CERTIFIED SOLUTION
Avatar of nacker2000
nacker2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
nacker2000, Can you suggest any useful tips to my question related to ffmpeg ?
https://www.experts-exchange.com/questions/24967652/ffmpeg-code-to-record-IPCam-video-to-FLV.html

Thanks
--Raj