Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I achieve the best overall FLV quality with FFMPEG?

I'm looking to accomplish the best quality FLV with the lowest file size. After all, isn't that everyone's goal? These videos will be streamed if that makes any difference.

For now, my video(s) are no wider than 320px, and some are widescreen, so their heights are a little smaller than 240px. As it stands, the quality of the converted FLVs is quite poor.

Current command:

> ffmpeg -i video.mov -ar 22050 -ab 32 -f flv -s 320x240 -aspect 4:3 video.flv
like image 906
dcolumbus Avatar asked Jul 07 '10 19:07

dcolumbus


2 Answers

By default flv defaults to 200Kb and with the qmax being as high as 30 (since you're not overriding it) it'll probably be producing output near that. You can fix this by either:

  • Setting qmax to a lower value forcing the quality control to up the birate to meet the requirement.
  • Upping the bitrate with -vb 400k

On the test video I just tried -qmax 10 gave acceptable output. Using qmax and qmin to set the lower and upper acceptable quality is the preferred way.

like image 80
Russ Avatar answered Oct 10 '22 02:10

Russ


I didn't have any luck with the options presented thus far - most of them had no effect on my input file, which was consistently producing poor-quality results - but the following worked very well indeed:

ffmpeg -qscale 4 -i infile.avi outfile.flv

Reduce the qscale value for better quality, increase it for a smaller file-size. From the docs:

-qscale n where n is a number from 1-31, with 1 being highest quality/largest filesize and 31 being the lowest quality/smallest filesize.

Tested on Mac OS X 10.6.8.

like image 25
halfer Avatar answered Oct 10 '22 03:10

halfer