'FFmpeg contact with filter on audio and video
I have this working ffmpeg command and I need to add an xfade filter
ffmpeg -f concat -safe 0 -i "concat:list.txt" -i "music.mp3" \
-filter_complex "[1]volume=0.1[1a];[0:a][1a]amix" \
-c:v copy -c:a aac -q:a 4 -r 25 "output.mp4"
I tried to add the command :
xfade=transition=fade:duration=2:offset=5
in the filter_complex.
The code that give me the error is
ffmpeg -f concat -safe 0 -i "concat:list.txt" -i "music.mp3" \
-filter_complex "[1]volume=0.1[1a];[0:a][1a]amix[2];[2]xfade=transition=fade:duration=2:offset=5" \
-c:v copy -c:a aac -q:a 4 -r 25 "output.mp4"
this is the error:
[Parsed_amix_1 @ 0000026f70206e00] Media type mismatch between the 'Parsed_amix_1' filter output pad 0 (audio) and the 'Parsed_xfade_2' filter input pad 0 (video)
[AVFilterGraph @ 0000026f70208c80] Cannot create the link amix:0 -> xfade:0
Error initializing complex filters.
Invalid argument
the file list.txt contains:
file '016698.mp4'
file '15128.mp4'
file '216749.mp4'
file '36680.mp4'
file '416700.mp4'
I tried in different ways but I can't find a way to make it work.
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
