<p>The audio.mp3 is likely shorter. Set <code>duration=first</code> in amix.</p>

CC BY-SA 4.0
2018-12-15T05:10:54.730Z
i tried your answer, not effect in finalvideo.
Jinal Somaiya
CC BY-SA 4.0
2018-12-15T08:37:38.140Z
Add -report and share report
Gyan
CC BY-SA 4.0
2018-12-15T08:50:11.137Z
report link: https://we.tl/t-ndnjeTj01z
Jinal Somaiya
CC BY-SA 4.0
2018-12-15T14:04:37.507Z
Log shows no errors. Share the inputs.
Gyan
CC BY-SA 4.0
2018-12-17T05:05:53.147Z
inputs: https://we.tl/t-5H8wTu8YhL
Jinal Somaiya
CC BY-SA 4.0
2018-12-18T06:45:37.193Z
i attached inputs link.
Jinal Somaiya
CC BY-SA 4.0
2018-12-18T10:20:04.507Z
Ok, will take a look.
Gyan
CC BY-SA 4.0
2018-12-20T04:56:43.527Z
i attached inputs link.
Jinal Somaiya
CC BY-SA 4.0
2018-12-14T14:26:20.693Z
2018-12-14T14:26:20.693Z
Gyan
<p>in below command final video is created but sound of second video is muted after some time.
here duration of audio and video is same.</p>

<pre><code>ffmpeg -y -i intro.mp4 -i videoaction.mp4 -i outro.mp4 -i audio1.mp3 -i vcs-watermark-video.png -filter_complex "[0:v]drawtext=fontfile=FutuMd.ttf: text=helloworld: 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,36,44)':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]" finalvideo.mp4
</code></pre>

<video><ffmpeg><audio>
ffmpeg add audio to video not working in below command
Jinal Somaiya
# ffmpeg add audio to video not working in below command

(Asked by: username_0 on 2018-12-14)

in below command final video is created but sound of second video is muted after some time.
here duration of audio and video is same.
ffmpeg -y -i intro.mp4 -i videoaction.mp4 -i outro.mp4 -i audio1.mp3 -i vcs-watermark-video.png -filter_complex "[0:v]drawtext=fontfile=FutuMd.ttf: text=helloworld: 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,36,44)':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]" finalvideo.mp4

**Tags:** video, ffmpeg, audio


---

## 1 answers

### Answer by username_1 on 2018-12-14. Score: 1

The audio.mp3 is likely shorter. Set `duration=first` in amix.

> **Comments:**
> **username_0**: i tried your answer, not effect in finalvideo.  
> **username_1**: Add -report and share report  
> **username_0**: report link: https://we.tl/t-ndnjeTj01z  
> **username_1**: Log shows no errors. Share the inputs.  
> **username_0**: inputs: https://we.tl/t-5H8wTu8YhL  
> **username_0**: i attached inputs link.  
> **username_1**: Ok, will take a look.  
> **username_0**: i attached inputs link.  

---

