Lets say I want every .mp4 file in a folder as an input file.
How does one do that? It only reads it literal.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityYou'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:
ffmpeg -f image2 -pattern_type glob -i '*.jpg' output.mp4
Just be aware that this depends entirely on the glob pattern to determine the order that the matched image files are processed.
ffmpeg
/avconv
doesn't support wildcards, but there are various ways around that. Egffmpeg $(printf -- "-i %s " *.mp4)
ffmpeg
an input file with no output file, then it just prints some info about the file. So that command in my previous comment prints some info about every.mp4
file in the current directory.ffmpeg
doesn't do wildcards, but it can handle numbered sets of files using%d
notation, both for input and output.ffmpeg
, which you can do with a bashfor
loop. Do you need help with that? FWIW, there's an example command to segment a video file into parts in this answer.