ffmpeg -y -i a.mp4 -i b.mp3 -filter_complex '[0]volume=1,atrim=start=0:end=5,adelay=0|0[aud0];[1]volume=1,atrim=start=0:end=5.796,adelay=0|0[aud1];[aud0][aud1]amix=2' mergeAudio.mp3
a.mp4 only video stream!
how to repair the code
In this particular case, use the anullsrc
filter to generate a silent stream and use that in amix
.
ffmpeg -y -i a.mp4 -i b.mp3 -f lavfi -i anullsrc -filter_complex '[2]volume=1,atrim=start=0:end=5,adelay=0|0[aud0];[1]volume=1,atrim=start=0:end=5.796,adelay=0|0[aud1];[aud0][aud1]amix=2' mergeAudio.mp3