title
Products            Buy            Support Forum            Professional            About            Codec Central
 

CLI Encoder How To?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesbaud

    • Jul 2006
    • 34

    #16
    Re: CLI Encoder How To?

    Now I'm trying to configure the CLI with FLAC.exe (again, I'm using the EXE to experiment with alpha builds and to play with switches not supported in the GUI).

    I tried this command line:

    -8 "[infile]" "[outfile]"

    I also unchecked all the boxes for "highest quality decoded source," "pass wave header," and "db Write ID Tags."

    When I try to encode a sample file (Windows XP Startup.wav) I get 2 files:
    Windows XP Startup.flac (0 bytes)
    Windows XP Startup.flac.tmp.flac (198,662 bytes)

    The tmp file is encoded correctly. Why do I get the tmp file at all? How do I fix the command line so I only get 1 correctly transcoded file?

    Comment

    • Spoon
      Administrator
      • Apr 2002
      • 44574

      #17
      Re: CLI Encoder How To?

      the .tmp.flac is written if there is already a file it will be overwriting. It is then renamed after conversion (which does not seem to be happening), perhaps the original file is locked, try deleting it.
      Spoon
      www.dbpoweramp.com

      Comment

      • jamesbaud

        • Jul 2006
        • 34

        #18
        Re: CLI Encoder How To?

        Originally posted by Spoon
        the .tmp.flac is written if there is already a file it will be overwriting. It is then renamed after conversion (which does not seem to be happening), perhaps the original file is locked, try deleting it.
        When you say "original file," I assume you mean the original wave file.

        When I use the Music Converter, I have it write the converted file to another (empty) directory, so it is not in the same directory as the original wave file.

        I experimented with the quotes (removing one set, then the other, removing both,) but still I get the 0k file and the .tmp.flac file that is correct. Here's the command line, followed by the debug log file. I used a different wav file than in the last post. After you look at it, would you have any other suggestions?

        -8 "[infile]" "[outfile]"

        Splitting Command Line:Done
        ->-> [dBCoreConverter::ReaddBCommandFile]
        <-<- [dBCoreConverter::ReaddBCommandFile]
        ->-> [cldBCodecHandler::FindDecoder]
        Checking Decoder 'C:\Program Files\dBpowerAMP\decoder\Wave.dll' for extension '.wav'
        Decodes [clDecoder::Get]
        <<< Match, using decoder
        Using Registry Cached Decoder: C:\Program Files\dBpowerAMP\decoder\Wave.dll
        <-<- [cldBCodecHandler::FindDecoder]
        BatchID [clDecoder::Set]
        ->-> [cldBCodecHandler::LoadEncoder]
        Loading Encoder 'C:\Program Files\dBpowerAMP\encoder\FLAC113.DLL'
        <-<- [cldBCodecHandler::LoadEncoder]
        BatchID [clEncoder::Set]
        ->-> [dBCoreConverter::StripCoreConverterCmds]
        <-<- [dBCoreConverter::StripCoreConverterCmds]
        SendRawUnCompressed [clEncoder::Get]
        Communicate [clDecoder::Get]
        Communicate [clEncoder::Get]
        NeedHQAudio [clEncoder::Get]
        ->-> [clDecoder::Open]
        Opening file 'C:\WINDOWS\Media\Windows XP Shutdown.wav' for read access: Opened
        Reading Audio Information
        ->-> [clWaveDecoder::Initialize]
        <-<- [clWaveDecoder::Initialize]
        ->-> [clRIFFHandler::Initialize]
        clRIFFHandler::CalcAllChunks: Ok
        <-<- [clRIFFHandler::Initialize]
        ->-> [clRIFFHandler::ScanFile]
        clRIFFHandler::CalcAllChunks: Ok
        RIFF Header 'RIFF' Length: 282600 FormType 'WAVE'
        Got Chunk 'fmt ' Length: 16 RiffSizeLeft: 282588 ChunkPosition: 12
        Got Chunk 'data' Length: 282564 RiffSizeLeft: 282564 ChunkPosition: 36
        clRIFFHandler::CalcAllChunks: Ok
        <-<- [clRIFFHandler::ScanFile]
        Read Audio Information
        ->-> [clWaveDecoder::ReadIDTags]
        ->-> [clWaveDecoder::PullOutFMTnDATA]
        Finding 'fmt ' chunk.
        Finding 'data' chunk.
        Assigning 'fmt ' chunk to WFX
        <-<- [clWaveDecoder::PullOutFMTnDATA]
        2 ID Tags:
        _riff_1: DATA Length: 4 fmt
        _riff_2: DATA Length: 4 data
        <-<- [clWaveDecoder::ReadIDTags]
        ->-> [clWaveDecoder::FillAudioProps]
        Audio Quality: Perfect (Lossless)
        Encoder Settings: PCM
        Wave Header: Wave Format PCM
        Channel Mapping: Left, Right
        Sample Count: 70,641
        Riff Chunks: 'fmt ' 16 bytes, 'data' 276 KB
        Gapless: Yes
        <-<- [clWaveDecoder::FillAudioProps]
        Writing Audio Information
        ->-> [clWaveDecoder::FillAudioInfo]
        Audio Length: 3203 mili-seconds 282564 bytes 705 kbps
        <-<- [clWaveDecoder::FillAudioInfo]
        Written Audio Information
        Preparing to Decode
        ->-> [clWaveDecoder::PrepareToDecodeAudio]
        Calling ACMDecoder.CreateNewConverter
        Compressed WFX (on file): Format Tag: 1 Channels: 2 Bits per Sample: 16 Samples Per Second: 22050 Bytes

        Per Second: 88200 Block Align: 4 CB Size: 0
        Uncompressed WFX (sent to db): Format Tag: 1 Channels: 2 Bits per Sample: 16 Samples Per Second: 22050

        Bytes Per Second: 88200 Block Align: 4 CB Size: 0
        Setting Position in File
        <-<- [clWaveDecoder::PrepareToDecodeAudio]
        Prepared Decoding
        <-<- [clDecoder::Open]
        ->-> [clEncoder::BeginConversion]
        Converting to 'C:\WUTemp\Windows XP Shutdown.flac' encoder settings ' -cli_encoder="C:\Program

        Files\FLAC\flac.exe" -cli_cmd="-8 {qt}[infile]{qt} {qt}[outfile]{qt}" -nowavehdr -nodbtag'
        Using Encoder 'C:\Program Files\FLAC\flac.exe'
        Command Line '-8 "C:\WUTemp\Windows XP Shutdown.flac.tmp.wav" "C:\WUTemp\Windows XP Shutdown.flac"'
        Input Wave Format:Format Tag: 1 Channels: 2 Bits per Sample: 16 Samples Per Second: 22050 Bytes Per

        Second: 88200 Block Align: 4 CB Size: 0
        Output Wave Format:Format Tag: 1 Channels: 2 Bits per Sample: 16 Samples Per Second: 22050 Bytes Per

        Second: 88200 Block Align: 4 CB Size: 0
        Passing Wave Header: No
        Using StdInput Pipe: No
        dBpoweramp Writing Tags: No
        <-<- [clEncoder::BeginConversion]
        Communicate [clDecoder::Get]
        Communicate [clEncoder::Get]
        Encoding To: FLAC113
        Encoder Cmd Line: -cli_encoder="C:\Program Files\FLAC\flac.exe" -cli_cmd="-8 {qt}[infile]{qt} {qt}[outfile]{qt}" -

        nowavehdr -nodbtag
        ============= CONVERSION BEGIN =============
        ============= CONVERSION END =============
        Communicate [clDecoder::Get]
        Communicate [clEncoder::Get]
        ->-> [dBCoreConverter::CloseDecoder]
        ->-> [clDecoder::Close]
        ->-> [clWaveDecoder::Close]
        <-<- [clWaveDecoder::Close]
        <-<- [clDecoder::Close]
        ->-> [clEncoder::EndConversion]
        Running program after conversion 'C:\Program Files\dBpowerAMP\encoder\FLAC113\' Command Line:
        Program completed
        <-<- [clEncoder::EndConversion]
        Communicate [clDecoder::Get]
        Communicate [clEncoder::Get]
        Conversion completed in 31 mili-seconds x103 realtime encoding

        Comment

        • Wayne
          dBpoweramp Guru

          • Aug 2002
          • 1254

          #19
          Re: CLI Encoder How To?

          I think that by original file Spoon is referring to an existing flac file, you previously created, that is about to be overwritten because it already exists. Unfortunately something is preventing it being deleted so that is the file you should delete not the source (wav) file.

          BTW Is this the source file C:\WUTemp\Windows XP Shutdown.flac.tmp.wav? maybe the problem is its name? Try renaming it first.

          Wayne
          Last edited by Wayne; February 09, 2007, 11:01 AM.

          Comment

          • jamesbaud

            • Jul 2006
            • 34

            #20
            Re: CLI Encoder How To?

            Originally posted by Wayne
            I think that by original file Spoon is referring to an existing flac file, you previously created, that is about to be overwritten because it already exists. Unfortunately something is preventing it being deleted so that is the file you should delete not the source (wav) file.

            BTW Is this the source file C:\WUTemp\Windows XP Shutdown.flac.tmp.wav? maybe the problem is its name? Try renaming it first.

            Wayne
            No, the source file is C:\WINDOWS\Media\Windows XP Shutdown.wav

            I set the destination directory as C:\WUTemp
            I make sure that there is nothing in that directory, no existing flac files, no files whatsoever.

            Whenever I try to run that command line, I get these 2 files:
            Windows XP Shutdown.flac (0 bytes)
            Windows XP Shutdown.flac.tmp.flac (198,662 bytes)

            Any other ideas?

            Comment

            • LtData
              dBpoweramp Guru

              • May 2004
              • 8288

              #21
              Re: CLI Encoder How To?

              Just to double-check, you deleted both FLAC files and tried the conversion again, correct? This is what Spoon and Wayne are talking about.

              Comment

              • jamesbaud

                • Jul 2006
                • 34

                #22
                Re: CLI Encoder How To?

                Originally posted by LtData
                Just to double-check, you deleted both FLAC files and tried the conversion again, correct? This is what Spoon and Wayne are talking about.
                Yes, I deleted both FLAC files and tried again. Same result.

                Comment

                • Spoon
                  Administrator
                  • Apr 2002
                  • 44574

                  #23
                  Re: CLI Encoder How To?

                  >Files\FLAC\flac.exe" -cli_cmd="-8 {qt}[infile]{qt} {qt}[outfile]{qt}" -nowavehdr -nodbtag'

                  With nowavehdr set FLAC will not know what the input source contained, ie isi the a raw audio file, flac cannot read that, it needs a wave file.

                  >Command Line '-8 "C:\WUTemp\Windows XP Shutdown.flac.tmp.wav" "C:\WUTemp\Windows XP Shutdown.flac"'

                  C:\WUTemp\Windows XP Shutdown.flac.tmp.wav

                  Is just a red herring, this is the decoded temporary file, before being passed onto the encoder. The problem with encoder must mean it is not being deleted. I will note this to look at.
                  Spoon
                  www.dbpoweramp.com

                  Comment

                  • jamesbaud

                    • Jul 2006
                    • 34

                    #24
                    Re: CLI Encoder How To?

                    Originally posted by Spoon
                    >Files\FLAC\flac.exe" -cli_cmd="-8 {qt}[infile]{qt} {qt}[outfile]{qt}" -nowavehdr -nodbtag'

                    With nowavehdr set FLAC will not know what the input source contained, ie isi the a raw audio file, flac cannot read that, it needs a wave file.

                    >Command Line '-8 "C:\WUTemp\Windows XP Shutdown.flac.tmp.wav" "C:\WUTemp\Windows XP Shutdown.flac"'

                    C:\WUTemp\Windows XP Shutdown.flac.tmp.wav

                    Is just a red herring, this is the decoded temporary file, before being passed onto the encoder. The problem with encoder must mean it is not being deleted. I will note this to look at.
                    This is the command line I used:

                    -8 "[infile]" "[outfile]"

                    When you say there is a problem with the encoder, are you referring to FLAC.exe or the CLI encoder codec?

                    Reading what you said about nowavehdr, I checked the box for "Pass Wave Header" and ran the result. I made sure to write the converted file to a different folder, and made sure the folder was empty: no flac or tmp or wav files. I got the same result:

                    Windows XP Startup.flac (0k)
                    Windows XP Startup.flac.tmp.flac (198,662k)

                    I think we're making progress ...

                    Here's the debug log file:

                    Splitting Command Line:Done
                    ->-> [dBCoreConverter::ReaddBCommandFile]
                    <-<- [dBCoreConverter::ReaddBCommandFile]
                    ->-> [cldBCodecHandler::FindDecoder]
                    Checking Decoder 'C:\Program Files\dBpowerAMP\decoder\Wave.dll' for extension '.wav'
                    Decodes [clDecoder::Get]
                    <<< Match, using decoder
                    Using Registry Cached Decoder: C:\Program Files\dBpowerAMP\decoder\Wave.dll
                    <-<- [cldBCodecHandler::FindDecoder]
                    BatchID [clDecoder::Set]
                    ->-> [cldBCodecHandler::LoadEncoder]
                    Loading Encoder 'C:\Program Files\dBpowerAMP\encoder\FLAC113.DLL'
                    <-<- [cldBCodecHandler::LoadEncoder]
                    BatchID [clEncoder::Set]
                    ->-> [dBCoreConverter::StripCoreConverterCmds]
                    <-<- [dBCoreConverter::StripCoreConverterCmds]
                    SendRawUnCompressed [clEncoder::Get]
                    Communicate [clDecoder::Get]
                    Communicate [clEncoder::Get]
                    NeedHQAudio [clEncoder::Get]
                    ->-> [clDecoder::Open]
                    Opening file 'C:\WINDOWS\Media\Windows XP Startup.wav' for read access: Opened
                    Reading Audio Information
                    ->-> [clWaveDecoder::Initialize]
                    <-<- [clWaveDecoder::Initialize]
                    ->-> [clRIFFHandler::Initialize]
                    clRIFFHandler::CalcAllChunks: Ok
                    <-<- [clRIFFHandler::Initialize]
                    ->-> [clRIFFHandler::ScanFile]
                    clRIFFHandler::CalcAllChunks: Ok
                    RIFF Header 'RIFF' Length: 424636 FormType 'WAVE'
                    Got Chunk 'fmt ' Length: 16 RiffSizeLeft: 424624 ChunkPosition: 12
                    Got Chunk 'data' Length: 424600 RiffSizeLeft: 424600 ChunkPosition: 36
                    clRIFFHandler::CalcAllChunks: Ok
                    <-<- [clRIFFHandler::ScanFile]
                    Read Audio Information
                    ->-> [clWaveDecoder::ReadIDTags]
                    ->-> [clWaveDecoder::PullOutFMTnDATA]
                    Finding 'fmt ' chunk.
                    Finding 'data' chunk.
                    Assigning 'fmt ' chunk to WFX
                    <-<- [clWaveDecoder::PullOutFMTnDATA]
                    2 ID Tags:
                    _riff_1: DATA Length: 4 fmt
                    _riff_2: DATA Length: 4 data
                    <-<- [clWaveDecoder::ReadIDTags]
                    ->-> [clWaveDecoder::FillAudioProps]
                    Audio Quality: Perfect (Lossless)
                    Encoder Settings: PCM
                    Wave Header: Wave Format PCM
                    Channel Mapping: Left, Right
                    Sample Count: 106,150
                    Riff Chunks: 'fmt ' 16 bytes, 'data' 415 KB
                    Gapless: Yes
                    <-<- [clWaveDecoder::FillAudioProps]
                    Writing Audio Information
                    ->-> [clWaveDecoder::FillAudioInfo]
                    Audio Length: 4814 mili-seconds 424600 bytes 705 kbps
                    <-<- [clWaveDecoder::FillAudioInfo]
                    Written Audio Information
                    Preparing to Decode
                    ->-> [clWaveDecoder::PrepareToDecodeAudio]
                    Calling ACMDecoder.CreateNewConverter
                    Compressed WFX (on file): Format Tag: 1 Channels: 2 Bits per Sample: 16 Samples Per Second: 22050 Bytes Per Second: 88200 Block Align: 4 CB Size: 0
                    Uncompressed WFX (sent to db): Format Tag: 1 Channels: 2 Bits per Sample: 16 Samples Per Second: 22050 Bytes Per Second: 88200 Block Align: 4 CB Size: 0
                    Setting Position in File
                    <-<- [clWaveDecoder::PrepareToDecodeAudio]
                    Prepared Decoding
                    <-<- [clDecoder::Open]
                    ->-> [clEncoder::BeginConversion]
                    Converting to 'C:\WUTemp\Windows XP Startup.flac' encoder settings ' -cli_encoder="C:\Program Files\FLAC\flac.exe" -cli_cmd=" -8 {qt}[outfile]{qt} {qt}[infile]{qt}" -nodbtag'
                    Using Encoder 'C:\Program Files\FLAC\flac.exe'
                    Command Line ' -8 "C:\WUTemp\Windows XP Startup.flac" "C:\WUTemp\Windows XP Startup.flac.tmp.wav"'
                    Input Wave Format:Format Tag: 1 Channels: 2 Bits per Sample: 16 Samples Per Second: 22050 Bytes Per Second: 88200 Block Align: 4 CB Size: 0
                    Output Wave Format:Format Tag: 1 Channels: 2 Bits per Sample: 16 Samples Per Second: 22050 Bytes Per Second: 88200 Block Align: 4 CB Size: 0
                    Passing Wave Header: Yes
                    Using StdInput Pipe: No
                    dBpoweramp Writing Tags: No
                    <-<- [clEncoder::BeginConversion]
                    Communicate [clDecoder::Get]
                    Communicate [clEncoder::Get]
                    Encoding To: FLAC113
                    Encoder Cmd Line: -cli_encoder="C:\Program Files\FLAC\flac.exe" -cli_cmd=" -8 {qt}[outfile]{qt} {qt}[infile]{qt}" -nodbtag
                    ============= CONVERSION BEGIN =============
                    ============= CONVERSION END =============
                    Communicate [clDecoder::Get]
                    Communicate [clEncoder::Get]
                    ->-> [dBCoreConverter::CloseDecoder]
                    ->-> [clDecoder::Close]
                    ->-> [clWaveDecoder::Close]
                    <-<- [clWaveDecoder::Close]
                    <-<- [clDecoder::Close]
                    ->-> [clEncoder::EndConversion]
                    Running program after conversion 'C:\Program Files\dBpowerAMP\encoder\FLAC113\' Command Line:
                    Program completed
                    <-<- [clEncoder::EndConversion]
                    Communicate [clDecoder::Get]
                    Communicate [clEncoder::Get]
                    Conversion completed in 16 mili-seconds x300 realtime encoding

                    Comment

                    • Spoon
                      Administrator
                      • Apr 2002
                      • 44574

                      #25
                      Re: CLI Encoder How To?

                      If flac has an option to force overwrite you need to specify that, otherwise it sits there asking overwrite yes/no, that would explain the wav file left as it is still in the conversion.
                      Spoon
                      www.dbpoweramp.com

                      Comment

                      • jamesbaud

                        • Jul 2006
                        • 34

                        #26
                        Re: CLI Encoder How To?

                        Originally posted by Spoon
                        If flac has an option to force overwrite you need to specify that, otherwise it sits there asking overwrite yes/no, that would explain the wav file left as it is still in the conversion.
                        Eureka! That did it!

                        FYI, here's the basic setting:

                        -8 "[infile]" -f -o "[outfile]"

                        (substitute 8 for your desired level of compression)

                        It even works after I added a few more settings:

                        -8 -V --replay-gain "[infile]" -f -o "[outfile]"

                        And also when I check all 3 boxes: 1) highest quality decoded source, 2) pass wave header, and 3) db write ID tags.

                        Thanks for your insight. I hope this helps others who may be experiencing the same difficulties. Now to test the 1.1.4 alpha ...

                        Comment

                        • Spoon
                          Administrator
                          • Apr 2002
                          • 44574

                          #27
                          Re: CLI Encoder How To?

                          Also your CLI encoder version looks old - it was passing long filenames for infile and outfile, hence you needed to close in quotes, the latest encoder is short pathnames, unicode compatible and does not need quotes (although they will not hurt).
                          Spoon
                          www.dbpoweramp.com

                          Comment

                          • jamesbaud

                            • Jul 2006
                            • 34

                            #28
                            Re: CLI Encoder How To?

                            Originally posted by Spoon
                            Also your CLI encoder version looks old - it was passing long filenames for infile and outfile, hence you needed to close in quotes, the latest encoder is short pathnames, unicode compatible and does not need quotes (although they will not hurt).
                            Old? I'm using CLI Encoder Release 1, which I downloaded directly from Codec Central:



                            Is there a newer version now available? If so, what's the link? Thx.

                            Comment

                            • Spoon
                              Administrator
                              • Apr 2002
                              • 44574

                              #29
                              Re: CLI Encoder How To?

                              Not to worry there is a new Release 2 very soon.
                              Spoon
                              www.dbpoweramp.com

                              Comment

                              Working...

                              ]]>