[MEncoder-users] Re-encoding mpeg-2 to Xvid problem.

Florian mynameisflorian at yahoo.com
Wed Dec 27 20:49:19 CET 2006


<!-- DIV {margin:0px;}-->I'm no expert, but I think lavc/mpeg4 will provide a higher quality output at the same bitrate when compared to Xvid.

"But one day I increased my bitrate to 1300, but I quickly 
saw that it was too high of a bitrate for mencoder to significantly 
shrink with"

huh?
a 1600 kb/sec file should be about twice as big as a 800kb/sec file.
Simply divide the bitrate by 8 (8 bits/byte) and multiply by the total
number of seconds to get the aprox video output size. Assuming the
output has audio, you would also do the same for the audio bitrate and
add them together. There is also some more bytes used by the container,
I usually assume 10% to be generous. (multiply total by 1.1). Hope this
helps! ((ab/8)*s + (vb/8)*s)*1.1

Note:  it is possible for the
actual output bitrate to be lower than the specified output bitrate.
Think of it as a maximum desired bitrate. Usually this bitrate is used
in 2-pass encoding unless it does not need that many bits to encode the
video.

mencoder input.mpg -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1024:pass=1 -o /dev/null
mencoder input.mpg -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1024:pass=2 -o output.avi

If
the input has alot of grain or noise in the video, i use "-vf hqdn3d"
to de-noise the input before encoding. This usually provides a higher
quality output unless the bitrate is very high (I use 4096 for high
quality DVD rips). You can also increase the quality by removing any
letter-boxing. Check the manpage under "video filters" ... use
crop[=w:h:x:y]. Make sure the output w/h are divisible by 16, otherwise
crop more or re-size using scale[=w:h]. Generally, it is recommended
that the video is scaled down instead of up.

- Florian



----- Original Message ----
From: Emery Guevremont <emery.guevremont at gmail.com>
To: MEncoder usage discussions <mencoder-users at mplayerhq.hu>
Sent: Wednesday, December 27, 2006 10:20:26 AM
Subject: [MEncoder-users] Re-encoding mpeg-2 to Xvid problem.

Hello everyone,

I've done a lot of research on this mailing list and google, but I still 
haven't found an answer to my problem. I recently set up a job on my 
mythtv box so I can re-encode my mpeg-2 recording to Xvid, but I can't 
seem to get a consistantly decent avi file size after the re-encoding.

Let's say I re-encode a mpeg-2 file, and its size is 4Gb, well lately 
I've only been able to reduce my 4Gb mpg file to a 2Gb avi file. Now 
here's the command I've been using.

/usr/bin/mencoder -quiet Reindeer_Games.mpg -oac mp3lame -ovc xvid
 
-xvidencopts pass=1:bitrate=687 -o /dev/null
/usr/bin/mencoder -quiet Reindeer_Games.mpg -oac mp3lame -ovc xvid 
-xvidencopts pass=2:bitrate=687 -o Reindeer_Games.mpg.avi

I've played around a lot with the bitrate option, and at one point I was 
able to use 800 for bitrate and reduce a 4Gb mpg to a 700Mb avi for my 
recordings. But one day I increased my bitrate to 1300, but I quickly 
saw that it was too high of a bitrate for mencoder to significantly 
shrink with. So I slowly started decreasing my bitrate down to 800 and 
now 687 and I'm still not able to get the results I used to get when I 
first started re-encoding with a bitrate of either 687 or 800.

The strange thing is, if I rerun the same command on my new avi file 
(let's say Reindeer_Games.mpg.avi) with this command:

/usr/bin/mencoder -quiet Reindeer_Games.mpg.avi -oac mp3lame -ovc xvid 
-xvidencopts pass=1:bitrate=687 -o /dev/null
/usr/bin/mencoder -quiet
 Reindeer_Games.mpg.avi -oac mp3lame -ovc xvid 
-xvidencopts pass=2:bitrate=687 -o Reindeer_Games.mpg.avi.avi

then I'll be able to shrink my avi down to something like 700Mb.

Anyone understand what I'm saying and what I need to do to fix this?
_______________________________________________
MEncoder-users mailing list
MEncoder-users at mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/mencoder-users






__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the MEncoder-users mailing list