Quantcast
Channel: MediaSPIP
Viewing all articles
Browse latest Browse all 118024

ffmpeg with "-pattern_type glob" and variable in bash script

$
0
0

I'm trying to let ffmpeg make a video of all pictures in a directory using the -pattern_type glob switch and "/foo/bar/*.jpg". This works well, if I execute the command manually für just one directory. For example:

ffmpeg -framerate 35 -pattern_type glob -i '/root/webcam_test/2018-07-21/*.jpg' -vf scale=1280:-1 -c -c:v libx264 -pix_fmt yuv420p /root/clips/out01_cut.mp4

However, if I do it in a bash script and set the path via a variable, according to ffmpegs output, the variable gets substituted correctly, but ffmpeg states that

'/root/webcam_test/2018-07-21/*.jpg': No such file or directory

The part of the script looks like this:

for D in `find /root/webcam_test/ -type d`
do [...] cmd="ffmpeg -framerate 35 -pattern_type glob -i '$D/*.jpg' -vf scale=1280:-1 -c -c:v libx264 -pix_fm t yuv420p /root/clips/$d_cut.mp4" echo $cmd
[...]
done

Does anyone know how to make ffmpeg do its wildcard interpretation even if the path is constructed by a script and not just try to plainly use the given path? Best regards and thanks in advance


Viewing all articles
Browse latest Browse all 118024

Trending Articles