[MPlayer-users] MENCODER question, AVI Compress to top quality, please help with ideas

Phil_Rhodes@rocketmail.com phil_rhodes at rocketmail.com
Tue Nov 25 08:37:00 CET 2008


This will be lengthy; sorry, no way around it. Complicated subject.

It really depends on who you want to be able to play it back. There are all 
kinds of things you could do, but, as you've correctly identified, you don't 
want something that needs esoteric software (such as mplayer!) to play back.

About the best possible combination of a good codec with easy playability is 
h.264, also (and somewhat incorrectly) referred to as MPEG-4. This codec 
works best for live-action video, as opposed to animation, but it tends to 
do a pretty good job all round. It is easiest to use ffmpeg to create this, 
as opposed to mencoder, because mencoder is very much oriented towards 
producing AVI. You need to be aware of the differences between a container 
format (such as AVI or Quicktime) and the codec that goes in it (such as 
h.264); a container can contain any one of a variety of compression formats.

mencoder is quite capable of creating an AVI containing an h.264 "payload", 
but not much will play it because that is, in the eyes of the wider world, a 
strange combination. ffmpeg, on the other hand, which is also free software, 
is capable of creating h.264 in the MPEG-4 wrapper, which is much more 
common. The advantage of this is that it can, if you set things up right, be 
played by Apple's Quicktime software, which is easily available but more 
importantly easy to specify - just say "play it with quicktime", and that's 
an instruction that's easy for people to follow.

So we have established a suitable codec and a container format, and a 
program capable of creating it.

There are a lot of guides on the web concerning the use of ffmpeg to create 
quicktime-compatible files. Quicktime isn't capable of reading all the 
subtleties of h.264 that ffmpeg is capable of creating, so you need to be 
quite careful about how you set things up. You will end up creating an 
ffmpeg command line which has a lot of stuff on it, and you'll want to save 
that command line for use in future when you want to do this again.

I use the Windows version of  "ffmpeg version SVN-r13712". You could start 
with something like this:

ffmpeg -i inputfile.avi -acodec libfaac -ab 256k -s 400x300 -vcodec 
libx264 -b 1500000 -flags +loop -cmp +chroma -partitions 
+parti4x4+partp8x8+partb8x8 -me umh -subq 5 -trellis 1 -refs 1 -coder 
0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 
1500000 -maxrate 10M -bufsize 10M -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 
4 -level 30 -y  output.mp4

Horrible, isn't it? Others on the list may have comments on things which 
might improve that; I am not a complete expert. You can, if it amuses you, 
go through the ffmpeg documentation and look up what it all means, but the 
bits you're likely to need to change are as follows:

-ab is the audio bitrate. This commandline will cause ffmpeg to create audio 
in the FAAC format, which is the format used on itunes to let people 
download music. Quicktime plays it well and it is technically somewhat 
better than mp3. 256k should sound "good" to "very good", even on things 
like string orchestras which are tricky.

-s is the pixel resolution of the output image. Adjust to suit.

-b is the video bitrate. Due to various glitches in Windows builds of ffmpeg 
(or something) it's best to set the -bt option to the same value. 1500000 is 
(I think) about 1.5 megabits per second, or about 200K of disk space a 
second, very much variable depending on picture content, which tends to be 
enough for h.264 to do a pretty good job on most video. Adjust to taste.

inputfile.avi should be your input file, outputfile.mp4 will be your output. 
When I tried that commandline, my middle-of-the-road computer encoded it at 
about 17fps, so it'll take longer than realtime to do the work.

P

----- Original Message ----- 
From: "Staci S" <antlamp at inorbit.com>
To: <mplayer-users at mplayerhq.hu>
Sent: Tuesday, November 25, 2008 5:47 AM
Subject: [MPlayer-users] MENCODER question, AVI Compress to top 
quality,please help with ideas


> Hello group:
>
> I have been struggling to try to reduce the size of a 480 megabyte
> uncompressed AVI. I would like to reduce it to under 200  megs... and not
> lose much color quality.
>
> I do see MENCODER probably has the capability to help, but I am lost in
> the sea of options it has. Does anyone know what I might/could try, ...
> to reduce the size, but not go too far with incompatible codecs or
> settings that would ruin the video on playback?
>
> I would be greatly appreciated for any insight!
>
> Best wishes, S.Smith
>
> -- 
> Be Yourself @ mail.com!
> Choose From 200+ Email Addresses
> Get a Free Account at www.mail.com
>
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users


--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.9.10/1810 - Release Date: 24/11/2008 
14:36




More information about the MPlayer-users mailing list