>>108544004
>like I need to add \"%s\"?
still not good, filenames containing quotes or special characters could break out of the quoting and do unexpected things
use one of:
import subprocess
subprocess.run(['ffmpeg', '-i', file, basename+'.jpg'])
import shlex
# must not put quotes around %s here or you get the same bug again
os.system('ffmpeg -i %s %s.jpg' % (shlex.quote(file), shlex.quote(basename)))
other things i'd change in your script
>check the file extensions case insensitively
>check the exit code of ffmpeg to tell whether it could actually convert the file (see documentation of os.system or subprocess.run)
>add -- before the output filename so ffmpeg won't interpret it as an option flag (https://unix.stackexchange.com/questions/11376/what-does-double-dash-double-hyphen-mean)
>tell ffmpeg what quality you want the jpeg in, the defaults are probably crap and subject to change