Lets say I want every .mp4 file in a folder as an input file.
How does one do that? It only reads it literal.
Best Answer
You're dealing with a directory of videos, so you will probably need to use a loop. The following loop will split each matched file into ten minute segments, as requested in your comment:
for i in *.mp4; do
ffmpeg -i "$i" -c copy \
-f segment -segment_time 600 \
-reset_timestamps 1 \
"${i/%.mp4/_part%02d.mp4}";
done
However, if your input is a directory of images, then the image2 demuxer lets you use wildcards. Just specify -pattern_type glob and pass your glob pattern to -i in a non-interpolated string (so that the shell does not expand it).
For example, I did the following when converting a directory of JPEG files to an MPEG-4 video:
I'm using the example from your previous question to use as an example for GNU parallel
ls *.mp4 | parallel ffmpeg -i {} fr1/{.}_%d.jpg -hide_banner
I can adjust the answer if this is not quite what you want. The “{}” gets replaced by GNU parallel with the whole file name, and “{.}” gets replaced by the file name with the last segment, separated by periods, removed.
Best Answer
You're dealing with a directory of videos, so you will probably need to use a loop. The following loop will split each matched file into ten minute segments, as requested in your comment:
However, if your input is a directory of images, then the image2 demuxer lets you use wildcards. Just specify
-pattern_type glob
and pass your glob pattern to-i
in a non-interpolated string (so that the shell does not expand it).For example, I did the following when converting a directory of JPEG files to an MPEG-4 video:
Just be aware that this depends entirely on the glob pattern to determine the order that the matched image files are processed.