android – FFMPEG concatenating videos with and without audios
I’m concatenating multiple videos using FFMPEG, with and without audios to certain videos, i’m using following command but FFMPEG generating error over (:a audio filer) Stream specifier ‘:a’ in filtergraph description, matches no streams.
Even I’m using anullsrc for videos having no sound.
Command:
ffmpeg -i Video_202306_23_102709.mp4 -i Video_202306_23_102838.mp4 -i Screenshot_298.mp4 -i MG16885528.mp4
-f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000
-filter_complex
[0:v]scale=1280×720:force_original_aspect_ratio=decrease,pad=1280×720:-1:-1,setsar=1,fps=24,format=yuv420p[v0];
[1:v]scale=1280×720:force_original_aspect_ratio=decrease,pad=1280×720:-1:-1,setsar=1,fps=24,format=yuv420p[v1];
[2:v]scale=1280×720:force_original_aspect_ratio=decrease,pad=1280×720:-1:-1,setsar=1,fps=24,format=yuv420p[v2];
[3:v]scale=1280×720:force_original_aspect_ratio=decrease,pad=1280×720:-1:-1,setsar=1,fps=24,format=yuv420p[v3];
[0:a]aformat=sample_rates=48000:channel_layouts=stereo[a0];
[1:a]aformat=sample_rates=48000:channel_layouts=stereo[a1];
[2:a]aformat=sample_rates=48000:channel_layouts=stereo[a2];
[3:a]aformat=sample_rates=48000:channel_layouts=stereo[a3];
[v0][a0][v1][a1][v2][a2][v3][a3]concat=n=4:v=1:a=1[v][a]
-map “[v]” -map “[a]” -c:v libx264 -crf 28 -c:a aac
-movflags +faststart FinalTempVideo.mp4
I’m following this query Concatenate Video in ffmpegby llogan,
It seems the :a filter is not utilize with the videos having no sound, but issue is that I couldn’t distinguish between the videos having audio or not.
Moreover anullsrc is not making it a fix.
Read more here: Source link