There are a couple of settings you need to change in
converter.php as well as a line to add.
First thing is to find this bit of code:
$mencoder_cmd = "$path_to_mencoder $raw_video_path -o $new_flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=800:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -vf scale=320:233 -srate 22050";and change the vbitrate from 800 to something higher. I use 2000. Change every vbitrate you see from 800 to a higher number like 2000. There should be a total of 3 places to change.
That alone didn't help me however. Through searching I found the answer in
this post by Code187
Here's what you need to do:
In
converter.php find this bit of code:
case 'wmv':
//UNCOMMENT THIS LINE OUTPUTS VERY HIGH QUALITY FLV -- FLV FILE MUCH LARGER
//$ffmpeg_cmd2 = "$config[path_to_ffmpeg] -i $raw_video_path -ab 64 -ar 44100 -b 300k -r 30 -s 720x480 -sameq $new_flv";
$ffmpeg_cmd2 = "$config[path_to_ffmpeg] -i $raw_video_path -copyts -ar 44100 -s 320x240 $new_flv";and replace it with this
case 'wmv':
//UNCOMMENT THIS LINE OUTPUTS VERY HIGH QUALITY FLV -- FLV FILE MUCH LARGER
$ffmpeg_cmd2 = "$config[path_to_ffmpeg] -i $raw_video_path -ab 64 -ar 44100 -b 300k -r 30 -s 400x304 -qmax 4 $new_flv";
//$ffmpeg_cmd2 = "$config[path_to_ffmpeg] -i $raw_video_path -copyts -ar 44100 -s 320x240 $new_flv";Note that not only did I uncomment the bit of code that was commented, but there are a few changes thanks to the info I found in
this post by Code187. Uncommenting the code alone will result in HUGE flv files. What I did here is change
-sameq to
-qmax 4 which allows you to set the quality level for your converted FLV's. The number represents the quality. The lower the number the better quality. So
-qmax 1 whould be the highest quality. Code187 recommended using
-qmax 5, however I found that
-qmax 4 worked better for me. Try different values and find one that suites you.
Now the problem here, is that bit only effects wmv files so what you need to do next is scroll down a bit and find this code:
case 'avi':
$ffmpeg_cmd2 = "$config[path_to_ffmpeg] -i $raw_video_path -copyts -ar 44100 -s 320x240 $new_flv";
@exec("$ffmpeg_cmd2");and replace it with this:
case 'avi':
$ffmpeg_cmd2 = "$config[path_to_ffmpeg] -i $raw_video_path -ab 64 -ar 44100 -b 300k -r 30 -s 400x304 -qmax 4 $new_flv";
// $ffmpeg_cmd2 = "$config[path_to_ffmpeg] -i $raw_video_path -copyts -ar 44100 -s 320x240 $new_flv";
@exec("$ffmpeg_cmd2");As you can see all we did here is take the same code and add it to the
case 'avi': bit
Now that I've done that, my video quality is awesome!
Here is an example of the quality I get: (note that I am NOT using an HD hosting service of any kind)
Watch "National Geographic - Demo"
Several people have asked for a copy of my convertor.php file. I have attached it to this post.
USE IT AT YOUR OWN RISK! Just make sure to make a backup copy of your existing
convertor.php file before using this one, just in case.
