FFMPEG blank tiny audio spot when concating












1















I am trying to concat some mp3 audio files with the following command:



ffmpeg -y -i concat:"1.mp3|2.mp3|3.mp3" -c copy output.mp3


FFMPEG leaves some tiny empty audio spots between the concatenated files, looking output.mp3 with Audacity i have:
enter image description here



Is there some functionality on FFMPEG to avoid these empty audio spots?










share|improve this question





























    1















    I am trying to concat some mp3 audio files with the following command:



    ffmpeg -y -i concat:"1.mp3|2.mp3|3.mp3" -c copy output.mp3


    FFMPEG leaves some tiny empty audio spots between the concatenated files, looking output.mp3 with Audacity i have:
    enter image description here



    Is there some functionality on FFMPEG to avoid these empty audio spots?










    share|improve this question



























      1












      1








      1








      I am trying to concat some mp3 audio files with the following command:



      ffmpeg -y -i concat:"1.mp3|2.mp3|3.mp3" -c copy output.mp3


      FFMPEG leaves some tiny empty audio spots between the concatenated files, looking output.mp3 with Audacity i have:
      enter image description here



      Is there some functionality on FFMPEG to avoid these empty audio spots?










      share|improve this question
















      I am trying to concat some mp3 audio files with the following command:



      ffmpeg -y -i concat:"1.mp3|2.mp3|3.mp3" -c copy output.mp3


      FFMPEG leaves some tiny empty audio spots between the concatenated files, looking output.mp3 with Audacity i have:
      enter image description here



      Is there some functionality on FFMPEG to avoid these empty audio spots?







      audio ffmpeg concatenation






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 16 '18 at 12:55







      Adriel Santos

















      asked Dec 25 '14 at 14:24









      Adriel SantosAdriel Santos

      1084




      1084






















          1 Answer
          1






          active

          oldest

          votes


















          5














          The LAME Technical FAQ has some relevant information. Here are some excerpts:




          Why does LAME add silence to the beginning each song?



          This is because of several factors:



          Decoder delay at start of file:



          All decoders I have tested introduce a delay of 528 samples. That is,
          after decoding an mp3 file, the output will have 528 samples of 0's
          appended to the front. This is because the standard MDCT/filterbank
          routines used by the ISO have a 528 sample delay.



          Furthermore, because of the overlapped nature of MDCT frames, the
          first half of the first granule (1 granule=576 samples) doesn't have a
          previous frame to overlap with, resulting in attenuation of the first
          N samples.



          Encoder delay at start of file:



          ISO based encoders (BladeEnc, 8hz-mp3, etc) use a MDCT/filterbank
          routine similar to the one used in decoding, and thus also introduce
          their own 528 sample delay. A .wav file encoded & decoded will have a
          1056 sample delay (1056 samples will be appended to the beginning).



          Starting with LAME 3.55, we have a new MDCT/filterbank routine written
          by Takehiro Tominaga with a 48 sample delay.




          Refer to the LAME Technical FAQ for additional related answers and more in-depth information.



          Some options that aren't great but might do the job:




          • Do you have to use MP3? Can you re-output your files to a different format such as PCM ("wav")? Note that simply re-encoding the existing MP3 files to another format will preserve the delay.


          • You can use the afade audio filter to add a fade out/fade in per section, or the atrim audio filter to possibly make the gaps less abrupt. However, filtering requires re-encoding.







          share|improve this answer
























          • Thanks for this answer. It's help me to find how I've got 50ms blank at startup.

            – ChoiZ
            Feb 11 '18 at 15:02











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f856769%2fffmpeg-blank-tiny-audio-spot-when-concating%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5














          The LAME Technical FAQ has some relevant information. Here are some excerpts:




          Why does LAME add silence to the beginning each song?



          This is because of several factors:



          Decoder delay at start of file:



          All decoders I have tested introduce a delay of 528 samples. That is,
          after decoding an mp3 file, the output will have 528 samples of 0's
          appended to the front. This is because the standard MDCT/filterbank
          routines used by the ISO have a 528 sample delay.



          Furthermore, because of the overlapped nature of MDCT frames, the
          first half of the first granule (1 granule=576 samples) doesn't have a
          previous frame to overlap with, resulting in attenuation of the first
          N samples.



          Encoder delay at start of file:



          ISO based encoders (BladeEnc, 8hz-mp3, etc) use a MDCT/filterbank
          routine similar to the one used in decoding, and thus also introduce
          their own 528 sample delay. A .wav file encoded & decoded will have a
          1056 sample delay (1056 samples will be appended to the beginning).



          Starting with LAME 3.55, we have a new MDCT/filterbank routine written
          by Takehiro Tominaga with a 48 sample delay.




          Refer to the LAME Technical FAQ for additional related answers and more in-depth information.



          Some options that aren't great but might do the job:




          • Do you have to use MP3? Can you re-output your files to a different format such as PCM ("wav")? Note that simply re-encoding the existing MP3 files to another format will preserve the delay.


          • You can use the afade audio filter to add a fade out/fade in per section, or the atrim audio filter to possibly make the gaps less abrupt. However, filtering requires re-encoding.







          share|improve this answer
























          • Thanks for this answer. It's help me to find how I've got 50ms blank at startup.

            – ChoiZ
            Feb 11 '18 at 15:02
















          5














          The LAME Technical FAQ has some relevant information. Here are some excerpts:




          Why does LAME add silence to the beginning each song?



          This is because of several factors:



          Decoder delay at start of file:



          All decoders I have tested introduce a delay of 528 samples. That is,
          after decoding an mp3 file, the output will have 528 samples of 0's
          appended to the front. This is because the standard MDCT/filterbank
          routines used by the ISO have a 528 sample delay.



          Furthermore, because of the overlapped nature of MDCT frames, the
          first half of the first granule (1 granule=576 samples) doesn't have a
          previous frame to overlap with, resulting in attenuation of the first
          N samples.



          Encoder delay at start of file:



          ISO based encoders (BladeEnc, 8hz-mp3, etc) use a MDCT/filterbank
          routine similar to the one used in decoding, and thus also introduce
          their own 528 sample delay. A .wav file encoded & decoded will have a
          1056 sample delay (1056 samples will be appended to the beginning).



          Starting with LAME 3.55, we have a new MDCT/filterbank routine written
          by Takehiro Tominaga with a 48 sample delay.




          Refer to the LAME Technical FAQ for additional related answers and more in-depth information.



          Some options that aren't great but might do the job:




          • Do you have to use MP3? Can you re-output your files to a different format such as PCM ("wav")? Note that simply re-encoding the existing MP3 files to another format will preserve the delay.


          • You can use the afade audio filter to add a fade out/fade in per section, or the atrim audio filter to possibly make the gaps less abrupt. However, filtering requires re-encoding.







          share|improve this answer
























          • Thanks for this answer. It's help me to find how I've got 50ms blank at startup.

            – ChoiZ
            Feb 11 '18 at 15:02














          5












          5








          5







          The LAME Technical FAQ has some relevant information. Here are some excerpts:




          Why does LAME add silence to the beginning each song?



          This is because of several factors:



          Decoder delay at start of file:



          All decoders I have tested introduce a delay of 528 samples. That is,
          after decoding an mp3 file, the output will have 528 samples of 0's
          appended to the front. This is because the standard MDCT/filterbank
          routines used by the ISO have a 528 sample delay.



          Furthermore, because of the overlapped nature of MDCT frames, the
          first half of the first granule (1 granule=576 samples) doesn't have a
          previous frame to overlap with, resulting in attenuation of the first
          N samples.



          Encoder delay at start of file:



          ISO based encoders (BladeEnc, 8hz-mp3, etc) use a MDCT/filterbank
          routine similar to the one used in decoding, and thus also introduce
          their own 528 sample delay. A .wav file encoded & decoded will have a
          1056 sample delay (1056 samples will be appended to the beginning).



          Starting with LAME 3.55, we have a new MDCT/filterbank routine written
          by Takehiro Tominaga with a 48 sample delay.




          Refer to the LAME Technical FAQ for additional related answers and more in-depth information.



          Some options that aren't great but might do the job:




          • Do you have to use MP3? Can you re-output your files to a different format such as PCM ("wav")? Note that simply re-encoding the existing MP3 files to another format will preserve the delay.


          • You can use the afade audio filter to add a fade out/fade in per section, or the atrim audio filter to possibly make the gaps less abrupt. However, filtering requires re-encoding.







          share|improve this answer













          The LAME Technical FAQ has some relevant information. Here are some excerpts:




          Why does LAME add silence to the beginning each song?



          This is because of several factors:



          Decoder delay at start of file:



          All decoders I have tested introduce a delay of 528 samples. That is,
          after decoding an mp3 file, the output will have 528 samples of 0's
          appended to the front. This is because the standard MDCT/filterbank
          routines used by the ISO have a 528 sample delay.



          Furthermore, because of the overlapped nature of MDCT frames, the
          first half of the first granule (1 granule=576 samples) doesn't have a
          previous frame to overlap with, resulting in attenuation of the first
          N samples.



          Encoder delay at start of file:



          ISO based encoders (BladeEnc, 8hz-mp3, etc) use a MDCT/filterbank
          routine similar to the one used in decoding, and thus also introduce
          their own 528 sample delay. A .wav file encoded & decoded will have a
          1056 sample delay (1056 samples will be appended to the beginning).



          Starting with LAME 3.55, we have a new MDCT/filterbank routine written
          by Takehiro Tominaga with a 48 sample delay.




          Refer to the LAME Technical FAQ for additional related answers and more in-depth information.



          Some options that aren't great but might do the job:




          • Do you have to use MP3? Can you re-output your files to a different format such as PCM ("wav")? Note that simply re-encoding the existing MP3 files to another format will preserve the delay.


          • You can use the afade audio filter to add a fade out/fade in per section, or the atrim audio filter to possibly make the gaps less abrupt. However, filtering requires re-encoding.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 25 '14 at 22:34









          lloganllogan

          25.2k54577




          25.2k54577













          • Thanks for this answer. It's help me to find how I've got 50ms blank at startup.

            – ChoiZ
            Feb 11 '18 at 15:02



















          • Thanks for this answer. It's help me to find how I've got 50ms blank at startup.

            – ChoiZ
            Feb 11 '18 at 15:02

















          Thanks for this answer. It's help me to find how I've got 50ms blank at startup.

          – ChoiZ
          Feb 11 '18 at 15:02





          Thanks for this answer. It's help me to find how I've got 50ms blank at startup.

          – ChoiZ
          Feb 11 '18 at 15:02


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f856769%2fffmpeg-blank-tiny-audio-spot-when-concating%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Сан-Квентин

          Алькесар

          Josef Freinademetz