View Full Version : Compressibility test perl script
echo
19th December 2005, 19:20
There was a perl script that evade had made in this thread. (http://forum.doom9.org/showthread.php?t=73124) I've been using it a lot but unfortunately I've lost it somewhere and the link that evade had provided doesn't work anymore. Does anyone have it? (are you still around evade?)
Thanks.
Sco0by
10th January 2006, 18:45
Hi everybody!
Here you go, I added some features, thanks evade :D :
#!/usr/bin/perl # Supply one argument a quoted string to complete the mencoder comand e.g. "-vf crop=720:352:0:60 stream.dump"
# Uncomment the following line for an XviD-Compress-Test:
$encoptions="-ovc xvid -xvidencopts fixed_quant=2:trellis:quant_type=mpeg:qpel:chroma_me:max_bframes=3:vhq=1:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31";
# Uncomment for an x264-Compress-Test:
#$encoptions="-ovc x264 -x264encopts qp_constant=19:cabac:deblock:frameref=3:bframes=2:b_adapt:qp_step=4:4x4mv:weight_b:chroma_me";
$second=0;
$cnt=0;
$tk=0;
$k=1;
until ( $k == "" ) { $k=`mencoder -nosound $encoptions -o /dev/null -ss ${second} -endpos 00:03 $ARGV[0] 2> /dev/null | grep 'Video stream'`;
$k =~ s/Video stream..//g;
$k =~ s/\..*\n//g;
$tk=${tk}+${k};
$cnt++;
$second=${second}+60;
printf "\rPosition: %02d:%02d", ($second/60), $second%60; }
$cnt--;
$ak=${tk}/${cnt};
$tb=${ak}*2/3;
print "\nAverage kbits/s = ${ak}. Go for ${tb}\n";
Save this to an file (e.g. comptest.pl) and use it like:
perl comptest.pl "-vf pp=de,crop=688:560:16:10 myTestFile.vob"
This compresses 3 seconds in intervals of 1 minute (=5% of the movie) using mencoder. Evades original used 6 seconds every 2 minutes, but some testing showed me, that the results using 3/60 sec are closer to those mencoder gives as average bitrate encoding the whole movie at fixed_quant=2.
Surprisingly, the "GKnot Windows-method" (14 out of 280 frames) gave a very high deviation from the value mencoder prints for the whole movie.
You can also do a x264-compress-test by using the corresponding settings (uncomment the line with $encoptions=... for x264).
Both, XviD and x264-settings, are from the "Doom9 Windows guides".
Please make your suggestions (settings, need and purpose of x264-compress-test, ...)
echo
10th January 2006, 19:22
Thank you so much! I have to say all these changes are very welcome! :)
six6
5th February 2006, 20:14
I agree, these changes are welcome. I will incorporate some incarnation of this into bitterbpp (http://www.derekfrye.com/bitterbpp), if it's under the GPL.
evade
23rd February 2006, 05:43
Yeah: free as in free speech, Include away.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.