How to fix the statistics not working problem

2012-03-28
2013-04-25
  • Scott Pitcher
    Scott Pitcher
    2012-03-28

    Hi,

    If you have a problem with all information in the statistics window stuck on zero while encoding, make the following small change to AcidRip/acidrip.pm …..

    Down on line 854 you will find the function encode …

    sub encode {
    

    … change the lines a little further down after the while (<MENCODER>) to read …

                while (<MENCODER>) {
        # Pos:3280.5s  82018f (71%) 41.87fps Trem:  12min 1436mb  A-V:0.067 [2500:114]
            if (/^Pos:\s*(\d+).\ds\s+(\d+)f\s+\(\s*(\d+)%\)\s+(\d+).(\d+)fps\s+Trem:\s+(\d+\w+)\s+(\d+mb).+\[([\d:]+)\]/) {
              if ( $1 ne $sec )  { $sec  = $1; $::widgets->{'menc_seconds'}->set_text( hhmmss($1) ) }
              if ( $4 ne $fps )  { $fps  = $4; $::widgets->{'menc_fps'}->set_text($4) }
              if ( $6 ne $size ) { $size = $7; $::widgets->{'menc_filesize'}->set_text($7) }
              if ( $5 ne $time ) { $time = $6; $::widgets->{'menc_time'}->set_text($6) }
              if ( $7 ne $rate ) { $rate = $8; $::widgets->{'menc_bitrate'}->set_text($8) }
              if ( $3 ne $prog ) {
    

    Later versions of mplayer/mencoder have small differences in the status output. Note my fix is actually poor, we really should be either checking our version of mplayer or else coding a regexp pattern which will match any output from mencoder (the best option), but I haven't done this yet - I just wanted to get it working.

    Feel free to mail me if you need help.

    Regards,
    Scott