有没有办法在 ffmpeg 完成文件转换之前暂停脚本?

Is there a way to pause a script until ffmpeg finishes converting a file?

我有一个 python 脚本会过早地将文件上传到云端(在它完成转换为 ogg 之前),如何在不使用类似 [=13= 的情况下暂停脚本直到转换完成]?

    cmd = ("ffmpeg -i " + mp4_file + " -y -loglevel quiet -ar 16000 -ac 1 -acodec libopus -vn " + audio_file)
    os.popen(cmd)

使用subprocess.run阻塞直到完成。

在 Python 3.5 及更早版本上,您应该使用 subprocess.call