N
N
Nextman2016-01-23 16:20:41
Command line
Nextman, 2016-01-23 16:20:41

How to combine each mp4 file from a folder with one file outside the folder using ffmpeg?

There are, say, 100 mp4 files in the folder, and from the outside there is one mp4 splash file.
It is necessary to add this splash screen to each file at the end.
All files have already been brought to the same characteristics. Therefore, you just need to glue in a loop through ffmpeg concat.
Who can say such a command?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
monah_tuk, 2016-01-25
@bitsmans

One team no. The loop on Shell (sh, bash) will look something like this:

ad=/path/endfile.mp4
clips_in=/path/
clips_out=/tmp/
for clip in $clips_in/*.mp4; do
  nm=`basename $clip .mp4`
  cat | ffmpeg -f concat -i - -c:v copy -c:a copy $clips_out/${nm}_out.mp4 << EOF
file $clip
file $ad
EOF
done

Concat to do in the way that you like best:
This method of gluing will not work for you: ffmpeg.org/ffmpeg-protocols.html#concat

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question