#28 add -s option to quiet output on stderr during encoding

open
nobody
None
5
2006-11-18
2006-11-18
Mark Nipper
No

I split this patch out from my stdout patch submitted in the bug section since this is technically not a bug and more importantly, because it changes things around enough that it should be dealt with separately by the maintainers.

The attached patch adds a -s option to silence all output on the command line from stderr since it is an easy option to implement and there are times (pass-through encoding inside an Apache process as an example) where no output is preferred. I realize that redirects could be used to accomplish the same thing, but this is a fairly standard option in other programs, and I wanted to use it myself which is why I added it locally.

Unfortunately, it does require one possibly significant change in the source. Previously, the banner text and libmp4 version check happened before the command line options were parsed. This made sense to avoid the additional processing time of the command line arguments (and any potential errors thrown during that process, specifically with the cover art option). But it also means that something was being printed to stderr BEFORE the command line options were getting parsed, thereby breaking the whole concept of this patch.

So the big change includes moving these few lines to AFTER where the command line arguments are parsed. This might be undesirable to some extent. But hopefully the option has enough merit to include it despite whatever potential problems people might find with this.

Feel free to change the exact variable name used to accomplish this functionality. I was trying to use something which made logical sense by using verbose and !verbose even though the option itself is -s for silence.

Discussion

  • Mark Nipper
    Mark Nipper
    2006-11-18

    patch to include -s option for silent run mode

     
    Attachments
  • Logged In: NO

    This would be really useful where faac is used from within scripts where stdout output goes to a log file, currently, log files will contain something like this:

    Encoding /tmp/1704_20061229183000.mpg.wav to /var/www/mythcast/Best of The Now Show 2006 (29-12-2006 18-30).m4a
    frame | bitrate | elapsed/estim | play/CPU | ETA
    ^M 26/83998 ( 0%)| 225.8 | 0.1/323.1 | 5.55x | 323.0 ^M 50/83998 ( 0%)| 227.5 | 0.2/289.0 | 6.20x | 288.8 ^M 100/83998 ( 0%)| 233
    .3 | 0.3/262.1 | 6.84x | 261.8 ^M 150/83998 ( 0%)| 233.3 | 0.5/253.1 | 7.08x | 252.7 ^M 200/83998 ( 0%)| 232.6 | 0.6/247.0 | 7
    .26x | 246.4 ^M 250/83998 ( 0%)| 231.1 | 0.7/243.3 | 7.37x | 242.5 ^M 300/83998 ( 0%)| 230.6 | 0.9/240.8 | 7.44x | 239.9 ^M 350/83998
    ( 0%)| 229.9 | 1.0/244.8 | 7.32x | 243.8 ^M 400/83998 ( 0%)| 223.3 | 1.2/245.3 | 7.31x | 244.1 ^M 450/83998 ( 0%)| 214.3 | 1.3/
    241.2 | 7.43x | 239.9 ^M 500/83998 ( 0%)| 208.0 | 1.4/239.2 | 7.49x | 237.8 ^M 550/83998 ( 0%)| 203.7 | 1.6/238.9 | 7.50x | 237.3
    ^M

    and so on...