[MEncoder-users] Flashvideo for YouTube using mencoder

Ben jultus at gmail.com
Fri Feb 22 05:53:36 CET 2008


Hi,

I've been using mencoder to publish video on YouTube quite succesfully
by uploading FLV files under 350 kbit/s so that YouTube does not convert them.
I'm just posting here what I think works really well, and would like to
improve quality further if possible.

My source is usually a HuffYUV lossless avi created using ffdshow, both
video and audio have already been filtered and resized/scaled/resampled,
so basically I only want the best transfer/conversion to FLV1, and for that
I prefer to use mencoder.

Here's an example encode command:

mencoder.exe lillydave.avi -o lillydave.flv
-mc 0 -ofps 29.97 -srate 44100
-oac mp3lame -lameopts vbr=2:q=8:aq=0:mode=1:lowpassfreq=16000
-ovc lavc -of lavf -lavfopts format=flv -lavcopts
vcodec=flv:vbitrate=261:keyint=148:
mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:precmp=2:cmp=2:subcmp=2:preme=2

The result of which was; http://youtube.com/watch?v=DYbibozTnWk
I prefer to use 24 or 25 frames/sec, but in this example I have maintained
framerate all the way to the flv, and the original was 29.970 fps.
A+V streamrate of this example is 349 kbit/s, so YouTube left it alone.

OK, any improvement on these choices of commands is welcomed!

To be complete, the CLI output of encoding this:
-------------------------------------------------
MEncoder Sherpya-SVN-r25513-4.2.2 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) D CPU 3.60GHz (Family: 15, Model: 6, Stepping: 4)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Cannot load bitmap font: c:\WINdows\Fonts\immortal.fon
success: format: 0  data: 0x0 - 0x73314704
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO:  [HFYU]  448x336  24bpp  29.970 fps  26858.9 kbps (3278.7 kbyte/s)
[V] filefmt:3  fourcc:0x55594648  size:448x336  fps:29.97  ftime:=0.0334
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
** MUXER_LAVF *****************************************************************
REMEMBER: MEncoder's libavformat muxing is presently broken and can generate
INCORRECT files in the presence of B frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!
*******************************************************************************
OK, exit
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffhuffyuv] vfm: ffmpeg (FFmpeg HuffYUV)
==========================================================================
MP3 audio selected.
VDec: vo config request - 448 x 336 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 2)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1])
[VE_LAVC] High quality encoding selected (non-realtime)!
VIDEO CODEC ID: 22
AUDIO CODEC ID: 15001, TAG: 0
Writing header...
Pos: 546.5s  16380f (100%) 22.83fps Trem:   0min  22mb  A-V:0.000 [262:77]
Flushing video frames.
Writing index...

Video stream:  262.658 kbit/s  (32832 B/s)  size: 17944325 bytes
546.547 secs  16380 f
rames

Audio stream:   77.401 kbit/s  (9675 B/s)  size: 5287509 bytes  546.508 secs
-------------------------------------------------

Btw; What's with the font-notice? I don't need a font in a commandline shell..

Regards, and thanks for this amazing encoder!

JB



More information about the MEncoder-users mailing list