I'm trying to pass a glob pattern to ffmpeg via subprocess.check_output(). This appears to be having an issue as the output is what I would expect if the pattern was passed within quotes.
Example:
subprocess.check_output([ffmpeg_path, '-pattern_type', 'glob', '-i', '/tmp/*?(jpg|jpeg)'...])
This results in:
/tmp/*?(jpg|jpeg): No such file or directory.
Which is different than the "no matches" error I receive if run this command via the shell. What appears to be happening is that the command is being composed as
ffmpeg -pattern_type 'glob' -i '/tmp/*?(jpg|jpeg)'
and what I'd want is (note lack of quotations)
ffmpeg -pattern_type glob -i /tmp/*?(jpg|jpeg)
Something of note is that I am passing in the directory so directory + '/*?(jpg|jpeg)' is what is in the list being passed to check_output(). This may be part of the issue.
How would I prevent this, or how would I pass the raw arguments desired?
ffmpeg version when running on development machine:
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 13.0.0 (clang-1300.0.29.3)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4.1_5 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
and using the ffmpeg amd64 static build when deployed.