Portal Home > Knowledgebase > Articles Database > some questions on converting videos


some questions on converting videos




Posted by Darvil, 11-29-2007, 01:59 PM
I got ffmpeg, mencoder and flvtool2 installed on my server (centos 4) but when I try use them, the size comes off substantially bigger then what I can do on my PC. For example I've been using Sorenson Squeeze (using Sorenson codec) and say at 240brate(video) and 32 (audio) and at 320-240, it comes to about 100 megs for a 50 min video. Is there some good strategy on using these free tools effectively? or do the free codecs just can't compare to the paid ones? What would be the commands that you guys would run to get the best size for those specified options I mentioned? On mencoder and flvtool2 that is. I have the latest versions installed. Thanks

Posted by SagoKyle, 11-29-2007, 02:22 PM
Regardless of the codec, if you have the bitrates the same, the size should be very close. Its the quality that will count. What is the exact command line that you are using? I want to say with ffmpeg there was a change where the bitrate was taken in as bytes instead of bits... (but don't quote me on that, the version I'm using is bits) Here is my command line exactly, its using a bunch of tweaked settings (that I admit don't know what all of them do): ffmpeg -i INPUT -ab 128 -ar 44100 -vcodec flv -b 1400k -s 640x360 -bt 100k -qmin 1 -qmax 15 -g 160 -cmp 3 -subcmp 3 -mbd 2 -flags +aic+cbp+mv0+mv4+trell OUTPUT It looks great, but the bitrate is probably higher than what most people want.

Posted by Darvil, 11-29-2007, 02:45 PM
Thanks. I'll give that a try. But I read that mencoder works better (smaller results)? You disgree?

Posted by SagoKyle, 11-29-2007, 03:35 PM
As far as I know, mencoder uses the same ffmpeg library for flv encoding. (http://en.wikipedia.org/wiki/Libavcodec) I like the syntax better on ffmpeg.

Posted by Darvil, 11-29-2007, 04:26 PM
Hey there. I changed your command to mine ffmpeg -i INPUT -ab 32 -ar 22050 -vcodec flv -b 240k -s 320x240 -bt 100k -qmin 1 -qmax 15 -g 160 -cmp 3 -subcmp 3 -mbd 2 -flags +aic+cbp+mv0+mv4+trell OUTPUT I converted a 150 meg wmv file and it became 277 meg flv. Although I noticed it mentioned 400+k instead of 272k bitrate. This is where I'm probably not doing it right.

Posted by SagoKyle, 11-29-2007, 04:44 PM
Haha No its ok, bt is bitrate tolerance which can control how much the bitrate fluctuates. What is the original bitrate? Wmv is pretty good to start, and you may not be able to get it any smaller without more loss. Here is calculator for bitrates: (it doesn't matter that it is for WMV's, a bitrate is a bitrate) http://www.citizeninsomniac.com/WMV/WMVBitCalc.html You can see that no matter how good or bad the compression is, you will always get a "bigger" file if you compress with a higher bitrate than the original.

Posted by SagoKyle, 11-29-2007, 04:51 PM
I'm sorry I misread what you are saying. This is weird, if it has the same bitrate is should be the same file size. What is the duration of this file?

Posted by Darvil, 11-29-2007, 05:58 PM
The video source is as I mentioned its 150 megs wmv. 320x240 and 240k video sound 32bits running the command I used above I get about 290 meg file. I reduced the quality to 140k from 240k and the file got to about 180 megs but as you might expect the video quality looks quite bad compared to the original. Now if I use Sorenson Squeeze and specify the same exact options I get an FLV file that is almost equal to the wmv file. Its probably off by a few megs which is fine and quality looks about the same. This isn't only just on wmv files though, on big files like avi (700 meg files) when I compress it with SS, I get around 100 megs for a 50 mins video but when I try it on the server it is much bigger like 300+ megs. I'm not sure whats going on which is why I was wondering. I'm probably doing something wrong. If you want I can show you a comparison between the 2 (I'll PM you the link.)



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
PHP Image functions (Views: 480)