Answers.Body: <p>The audio.mp3 is likely shorter. Set <code>duration=first</code> in amix.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-15T05:10:54.730Z
Answers.Text: i tried your answer, not effect in finalvideo.
Answers.UserDisplayName: Jinal Somaiya
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-15T08:37:38.140Z
Answers.Text: Add -report and share report
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-15T08:50:11.137Z
Answers.Text: report link: https://we.tl/t-ndnjeTj01z
Answers.UserDisplayName: Jinal Somaiya
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-15T14:04:37.507Z
Answers.Text: Log shows no errors. Share the inputs.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-17T05:05:53.147Z
Answers.Text: inputs: https://we.tl/t-5H8wTu8YhL
Answers.UserDisplayName: Jinal Somaiya
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-18T06:45:37.193Z
Answers.Text: i attached inputs link.
Answers.UserDisplayName: Jinal Somaiya
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-18T10:20:04.507Z
Answers.Text: Ok, will take a look.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T04:56:43.527Z
Answers.Text: i attached inputs link.
Answers.UserDisplayName: Jinal Somaiya
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-14T14:26:20.693Z
Answers.LastActivityDate: 2018-12-14T14:26:20.693Z
Answers.UserDisplayName: Gyan
Body: <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>
  
Tags: <video><ffmpeg><audio>
Title: ffmpeg add audio to video not working in below command
UserDisplayName: Jinal Somaiya
ThreadText: # 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.  
  
  ---
  
  