I have a video with audio that I am trying to merge with 2 images - one image before the video starts and one image after the video ends - but right now I am getting this error -
Stream specifier ':a' in filtergraph description [0:v] [0:a] [1:v] [2:a] concat=n=3:v=1:a=1 [v] [a] matches no streams.
This is the code I am using -
ffmpeg \
-loop 1 -framerate 24 -t 10 -i default_start.png \
-i output-first.mp4 \
-loop 1 -framerate 24 -t 10 -i default_end.png \
-f lavfi -t 3 -i anullsrc \
-filter_complex "[0:v] [0:a] [1:v] [2:a] concat=n=3:v=1:a=1 [v] [a]" \
-c:v libx264 -c:a aac -map "[v]" -map "[a]" -y output-second.mp4 2>&1
EDIT
I am also trying to use 2 different commands, each using 1 image file instead of two --
// Image at start only
ffmpeg -y \
-loop 1 -framerate 24 -t 10 -i default_start.png \
-i output-first.mp4 \
-f lavfi -t 3 -i anullsrc \
-filter_complex "[0:v] [2:a] [1:v] [1:a] [2:v] [3:a] concat=n=2:v=1:a=1 [v] [a]" \
-c:v libx264 -c:a aac -map "[v]" -map "[a]" output-second.mp4 2>&1
// Image at end only
ffmpeg -y \
-i output-first.mp4 \
-loop 1 -framerate 24 -t 10 -i default_end.png \
-f lavfi -t 3 -i anullsrc \
-filter_complex "[0:v] [3:a] [1:v] [1:a] [2:v] [3:a] concat=n=3:v=1:a=1 [v] [a]" \
-c:v libx264 -c:a aac -map "[v]" -map "[a]" output-second.mp4 2>&1
Answer
You need to map the concat inputs with the corresponding file inputs:
ffmpeg -y \
-loop 1 -framerate 24 -t 10 -i default_start.png \
-i output-first.mp4 \
-loop 1 -framerate 24 -t 10 -i default_end.png \
-f lavfi -t 3 -i anullsrc \
-filter_complex "[0:v] [3:a] [1:v] [1:a] [2:v] [3:a] concat=n=3:v=1:a=1 [v] [a]" \
-c:v libx264 -c:a aac -map "[v]" -map "[a]" output-second.mp4
Comments
Post a Comment