I am using following command to merge two audio file, which works fine.

ffmpeg -i main.mp3 -filter_complex "amovie=tag.wav:loop=0,asetpts=N/SR/TB[tag]; [0][tag]amix=duration=shortest,volume=2" tag-out.mp3

But what I really need to do is repeat and delay 10 seconds the audio tag depending on the main song length. Also, the main song audio volume lowers while the audio tag plays.

Any ideas/help appreciated. Thanks.

  • This command already repeats the tag. What does delay 10 seconds mean - - the initial start time of the tag?
    – Gyan
    Jan 19 '19 at 4:45
  • Yes, I want to play tag file after each 10 seconds like main audio file length is 50 seconds then tag file should be merge only 5 time on every 10 seconds of position. Jan 19 '19 at 7:34
  • @Gyan looking for your help -- thanks . Jan 19 '19 at 11:48

Since you wish to alter effective length of the tag, skip the amovie looping and use the aloop filter after padding the audio to 10s.

ffmpeg -i main.mp3 -filter_complex "amovie=tag.wav,asetpts=N/SR/TB,apad=whole_dur=10,aloop=-1:1M:0[tag]; [0][tag]amix=duration=shortest,volume=2" -vn tag-out.mp3
  • mentioned command is not working, Please check the following execution response. r Metadata: encoder : Lavc56.26 [mp3 @ 0x1b59ee0] Estimating duration from bitrate, this may be inaccurate [Parsed_apad_2 @ 0x1b73760] Option 'whole_dur' not found [AVFilterGraph @ 0x1b4b460] Error initializing filter 'apad' with args 'whole_dur=10' Error configuring filters. root@bea [/home/petarandzic/public_html/media]# Jan 20 '19 at 13:15
  • You'll need a recent static git/snapshot build.
    – Gyan
    Jan 20 '19 at 13:47
  • Thanks for your response, please check this this snapshot beatscentral.co/media/ffmpeg.png Jan 20 '19 at 16:00
  • That's version 2.6.8. Get a git build from johnvansickle.com/ffmpeg
    – Gyan
    Jan 20 '19 at 16:25
  • Thank you so much, provided command working fine as per my expectation but there is showing some error. can you please check this attached screen shot beatscentral.co/media/ffmpeg-3.png many thanks for your help. Jan 20 '19 at 19:33

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.