Mercurial > mplayer.hg
view TOOLS/countquant.pl @ 36545:f0e92381681d
Add support for files with MLTI chunks.
Fixes 06.rm and 08_lect_01.rm from FFmpeg trac #2152
Fixes also files from ftp://ftp.aduni.org/videos/
The patch has these limitations:
- no multirate files with MLTI chunks
- no mixed files (eg. MLTI for audio but not for video)
- no MLTI for video together with non-ra audio (eg. ralf)
- only DATA v0 (no v1, versions greater than 1 should not exist)
Files with these feature shuld not really exist anyway.
Also video MLTI files with only one stream are supported but untested
author | rtogni |
---|---|
date | Sun, 19 Jan 2014 15:12:46 +0000 |
parents | 32725ca88fed |
children |
line wrap: on
line source
#!/usr/bin/perl -w sub display_quants { $frames = 0; foreach $key (sort(keys(%quants))) { $frames += $quants{$key}; } foreach $key (sort({ $a <=> $b } keys(%quants))) { printf("q=%d:\t% 6d, % 6.2f%%\n", $key, $quants{$key}, $quants{$key} * 100 / $frames); } print("$lines lines processed, $frames frames found\n"); printf("average quant. is: %f\n", $quant_total/$frames); } $lines = 0; $thislines = 0; $quant_total = 0; while (<STDIN>) { $lines++; $thislines++; if (/ q:([0-9]+) /) { $quants{$1}++; } elsif (/ q:(([0-9]+)\.[0-9]+) /) { $quants{$2}++; $quant_total += $1; } if ((scalar(@ARGV) > 0) && ($thislines > $ARGV[0])) { display_quants(); $thislines = 0; } } display_quants();