aboutsummaryrefslogtreecommitdiff
path: root/bin/psycamp
diff options
context:
space:
mode:
authorpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>2016-08-10 15:28:29 +0000
committerpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>2016-08-10 15:28:29 +0000
commit51c69cbb931ae9db24324ea8874e6ce1e2e9d7c1 (patch)
tree79f6ec77489f541586f4b491595f090a85838c6a /bin/psycamp
parent5a24e0e643885a16e7c3b7b6ac50e4db31e476d0 (diff)
downloadperlpsyc-51c69cbb931ae9db24324ea8874e6ce1e2e9d7c1.tar.gz
perlpsyc-51c69cbb931ae9db24324ea8874e6ce1e2e9d7c1.zip
bitrate estimation trick
Diffstat (limited to 'bin/psycamp')
-rwxr-xr-xbin/psycamp12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/psycamp b/bin/psycamp
index 2502819..166f719 100755
--- a/bin/psycamp
+++ b/bin/psycamp
@@ -378,6 +378,18 @@ sub ginread {
378 $CurrentFile !~ /\b$KEEP\b/oi) { 378 $CurrentFile !~ /\b$KEEP\b/oi) {
379 print RED, unlink ($CurrentFile) ? 379 print RED, unlink ($CurrentFile) ?
380 "\r***" : "\r - ", BOLD, GREEN, "[\n", RESET; 380 "\r***" : "\r - ", BOLD, GREEN, "[\n", RESET;
381 } elsif ($DUR/1000 - $tc > 4) {
382 # Both ffmpeg and mplayer have a bug of
383 # dividing the sum of frame bitrates by
384 # the duration of the complete track, thus
385 # counting zero for the missing part. This
386 # formula compensates for that bug.
387 my $estira = $I{bitrate} * $DUR/$tc/1000;
388 printf "%s%sIncomplete file. Estimated actual bitrate: %.1f%s\n", BOLD, YELLOW, $estira, RESET if $estira < 1000 and $estira > 50;
389 # Then again, this approach sometimes
390 # fails if mplayer doesn't let us have
391 # the actual last timecode of the file -
392 # which it unpredictably does.
381 } else { 393 } else {
382 my $m = $date[$order[$CS]]; 394 my $m = $date[$order[$CS]];
383 # touch the access time of the file 395 # touch the access time of the file