#39 Faad: Add wav header to stdio ouput

open
nobody
None
5
2008-11-09
2008-11-09
Tebasuna
No

When the -w flag is selected the output is always RAW PCM. I know we can't write a full WAV header until the eof is reached but there are many encoders than accept incomplete headers with parameters like -readtoeof 1 (Aften), --ignorelength (oggenc2), ...

This is my request:
-f X Set output format. Valid values for X are:
1: Microsoft WAV format (default for file output).
Force incomplete wav header when -w is selected.
2: RAW PCM data (default for stdio output).

Now is backwards compatible and the incomplete wav header require a explicit parameter.

Now transcoding can be:

faad -w -f 1 input.aac | aften -ignorelength - output.ac3

Thanks.

Discussion

  • Tebasuna
    Tebasuna
    2008-11-09

    Sorry, I don't know how edit and I mistake the parameter with Aften, must be:
    faad -w -f 1 input.aac | aften -readtoeof 1 - output.ac3

     
  • Tebasuna
    Tebasuna
    2008-11-12

    I think is so simple than:

    --- faad2/frontend/main.c Wed Nov 12 13:38:42 2008
    +++ faad2/frontend/main_mod.c Wed Nov 12 13:49:42 2008
    @@ -1012,7 +1012,7 @@
    int object_type = LC;
    int def_srate = 0;
    int downMatrix = 0;
    - int format = 1;
    + int format = 0;
    int outputFormat = FAAD_FMT_16BIT;
    int outfile_set = 0;
    int adts_out = 0;
    @@ -1189,10 +1189,12 @@
    return 1;
    }

    - /* only allow raw data on stdio */
    - if (writeToStdio == 1)
    - {
    - format = 2;
    + /* only allow raw data on stdio (by default)*/
    + if (format == 0) {
    + if (writeToStdio == 1)
    + format = 2;
    + else
    + format = 1;
    }

    /* point to the specified file name */

     
  • Tebasuna
    Tebasuna
    2009-02-22

    Thanks.

    In Faad 2.7 we can send the wav header to STDOUT.
    We don't need use the -f 1 parameter because the change was only:

    - /* only allow raw data on stdio */
    - if (writeToStdio == 1)
    - {
    - format = 2;
    - }

    You can close this feature request.