With audio files A and B:

A : |--- Some content ---|--- Extra content --- |

B : |--- Some content ---|

Assume the end of B is where the start of the extra content in A.

I want to append that extra content at the end of B.

Can I achieve this with some command line programs, such as ffmpeg?

  • Do you know the duration of B? Do the files have the same format/codec properties?
    – Gyan
    Mar 18 '19 at 5:40
  • I think I could get the duration of B with some methods. A and B may or maybe in different codecs.
    – kit
    Mar 18 '19 at 6:28

Assuming the duration of B is X (in seconds), you would use

ffmpeg -i A -i B -filter_complex "[0]volume=0:enable='lt(t,X)'[a];[a][1]amix=duration=first:dropout_transition=0,volume=2" out
ffmpeg -f concat -i playlist.txt $OTHER_OPTIONS

In playlist.txt, write this:

file 'B'
file 'A'
inpoint <start_of_extra_content>

Would you like to know more?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.