subprocess call ffmpeg (command line)

前端 未结 4 661
轻奢々
轻奢々 2020-12-31 11:16

I have been incorporating subprocess calls in my program. I have had no issues with subprocess calls for other commands, but I am having trouble getting the command line inp

4条回答
  •  不思量自难忘°
    2020-12-31 12:06

    'ffmpeg -r 10 -i frame%03d.png -r ntsc movie.mpg' should be fine. OTOH, If you don't need the power of frame%03d.png, frame*.png is a bit simpler.

    If you want to "see the syntax for it if I replace 'movie.mpg' with a variable name", it looks something like this:

    cmd = 'ffmpeg -r 10 -i "frame%%03d.png" -r ntsc "%s"' % moviename

    We need to escape the % with an extra % to hide it from Python's % substitution machinery. I've also added double quotes " , to cope with the issues that tdelaney mentioned.

提交回复
热议问题