0

here i have one command that is working properly but i want to add audio to second and third video not only second video.So, how to proceed?

fmpeg -y -i intro-17may.mp4 -i video.mp4 -i outro.mp4 -i energy-song.mp3 -i vcs-watermark-video.png -filter_complex "[0:v]drawtext=fontfile=FutuMd.ttf: text='Hello World': x=300: y=450: fontsize=40: fontcolor=white: enable='between(t,2,5)',fade=t=out:st=5:d=1,setpts=PTS-STARTPTS[v0]; \
[1:v][4]overlay=W-w-5:H-h-5,fade=t=in:st=0:d=1,fade=t=out:st=63:d=1,setpts=PTS-STARTPTS[v1]; \
[2:v]fade=t=in:st=0:d=1,setpts=PTS-STARTPTS[v2]; \
[3:a]volume=enable='between(t,34,36)':volume=-8dB,volume=enable='between(t,36,42)':volume=-10dB,volume=enable='between(t,47,51)':volume=-8dB,volume=enable='between(t,51,58)':volume=-10dB[3a];[1:a][3a]amix=inputs=2:duration=shortest[maina]; \
[v0][0][v1][maina][v2][2]concat=n=3:v=1:a=1[outv][outa]" -vcodec libx264 -c:a aac -ac 2 -map "[outv]" -map "[outa]" c4.mp4

1 Answer 1

1

Use

ffmpeg -y -i intro-17may.mp4 -i video.mp4 -i outro.mp4 -i energy-song.mp3 -i vcs-watermark-video.png -filter_complex "[0:v]drawtext=fontfile=FutuMd.ttf: text='Hello World': x=300: y=450: fontsize=40: fontcolor=white: enable='between(t,2,5)',fade=t=out:st=5:d=1,setpts=PTS-STARTPTS[v0]; \
[1:v][4]overlay=W-w-5:H-h-5,fade=t=in:st=0:d=1,fade=t=out:st=63:d=1,setpts=PTS-STARTPTS[v1]; \
[2:v]fade=t=in:st=0:d=1,setpts=PTS-STARTPTS[v2]; \
[3:a]volume=enable='between(t,34,36)':volume=-8dB,volume=enable='between(t,36,42)':volume=-10dB,volume=enable='between(t,47,51)':volume=-8dB,volume=enable='between(t,51,58)':volume=-10dB,adelay=6000|6000[3a]; \
[v0][0][v1][1:a][v2][2]concat=n=3:v=1:a=1[outv][outa];[outa][3a]amix=inputs=2:duration=shortest[outa]" -vcodec libx264 -c:a aac -ac 2 -map "[outv]" -map "[outa]" c4.mp4

The BG music is delayed by 6000 ms (duration of intro) and then mixed with the audio after concat.

4
  • i tried but audio is not added in outro why? Jun 25, 2018 at 8:25
  • How long is the BG music?
    – Gyan
    Jun 25, 2018 at 8:27
  • Audio music is 1:04 long and outro video has audio of 6 seconds long. Jun 25, 2018 at 8:30
  • Your BG music isn't long enough. Your main video is at least 1:04 long according to the fade filters applied.
    – Gyan
    Jun 25, 2018 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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