Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd March 2004, 17:17   #1  |  Link
evade
Registered User
 
Join Date: Nov 2003
Posts: 97
Questions about compressibility

What is the best way to get a ballpark compressiblity with XviD and mencoder?

I generally use XviD options like this on a two-pass encode:

v4mv:turbo=1:trellis:chroma_me:vhq=4:autoaspect

Should I use the bitrate produced in the first pass to calculate the bpp and use a percentage of that?

However, I know that XviD turns off some of its quality enhancingfeatures to speed up the first pass so is it perhaps more accurate todoa partial fixed_quant=2 with these options calculate the bpp and usesome percentage of that?

Is 60% of this bpp a good value?


Also has anyone done or seen any recent comparisons between XviD and Libavcodec?
evade is offline   Reply With Quote
Old 23rd March 2004, 08:53   #2  |  Link
frodoontop
Registered User
 
frodoontop's Avatar
 
Join Date: Jan 2003
Location: Netherlands
Posts: 126
It makes no sense to encode first pass with fixed_quant=2, because filesize is only little different than a fast pass. Xvid will automatically make a correction for this in 2nd pass.

Use Turbo only if encoding time is a issue, it will give slightly lower quality. 2 B-frames boost quality also, but they're already default nowadays.

Don't know if sixty percent is enough for you. I usually aim for 80-90 percent. But then again: I hate macro-blocks. You might like a higher resolution for instance.
frodoontop is offline   Reply With Quote
Old 23rd March 2004, 19:21   #3  |  Link
echo
Registered User
 
echo's Avatar
 
Join Date: Jan 2003
Posts: 130
I've been thinking on how to do proper compressibility tests with mplayer as well. In order to do it the way I am used to in windows you have to select a random 5% of the video encoded at fixed quant 2. I thought that maybe a simple and efficient way is to take the first 3 seconds of every minute. So if you do something like this:

mencoder -ss 60 -endpos 3 -xvidopts fixed_quant=2:_other_options_
mencoder -ss 120 -endpos 3 -xvidopts fixed_quant=2:_other_options_
mencoder -ss 180 -endpos 3 -xvidopts fixed_quant=2:_other_options_
mencoder -ss 240 -endpos 3 -xvidopts fixed_quant=2:_other_options_
...
and so on until the end of the video, you will get several small 3second files. Now you can get each files bitrate from the video itself or capture it from the mencoder messages and calculate its average bitrate. Once you get that you can go to 60% of that and you have a nice compressibility test for the selected output video size. Ofcourse it becomes a little bit tiresome since you have to make about 90 small encodes for a 1,5 hour movie.

I know very little about linux scripting so if someone could recomment a script that does exactly this and calculates the average bitrate automatically it would be very helpful. Ofcourse once you get the target bitrate you can do a normal 1st pass the way you like it including turbo option or whatever... I hope I helped...

regards
echo
echo is offline   Reply With Quote
Old 23rd March 2004, 22:08   #4  |  Link
evade
Registered User
 
Join Date: Nov 2003
Posts: 97
Thanks for the advice, I will have more to say later.


@echo

The following script this shoud do what you want it to do.
execute it like this:
./comptest.sh dvd://1 7200 "-vf crop=704:464:0:0"




EDIT:

My Script didn't work, limitations of bash scalar variables, Iv'e rewritten it in perl and am testing it now, I will post it soon.

sorry

Last edited by evade; 24th March 2004 at 04:19.
evade is offline   Reply With Quote
Old 24th March 2004, 05:32   #5  |  Link
evade
Registered User
 
Join Date: Nov 2003
Posts: 97
As Promised here is a perl script to do a comptest. Adjust the xvidencopts as you see fit.
I've already noticed changing options significantly changes the bitrate produced.

This script is smarter than the last and can tell when the movie has ended. You only need to supply one argument, the last portion of your mencoder command line. Run it like this:

./comptest.pl "-vf crop=720:352:0:60 stream.dump"

or

./comptest.pl "-vf crop=720:352:0:60,scale=640:480,hqdn3d dvd://1"

If you want it you can download it here:

http://69.13.241.21/comptest.pl

Last edited by evade; 24th March 2004 at 05:34.
evade is offline   Reply With Quote
Old 24th March 2004, 19:56   #6  |  Link
echo
Registered User
 
echo's Avatar
 
Join Date: Jan 2003
Posts: 130
Thanks evade! That's exactly what I was looking for to make my life easier! I will test it as soon as I get to my linux box, but it seems to do everything correctly. I think its time to move entirely to linux now...

regards
echo
echo is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.