python-3.x - 在 Python 3.6 中传递 os.system 调用的参数

标签 python-3.x ffmpeg

我想将音频文件切成相等的 20 秒片段,并想将输出文件重命名为 fname0.wav、fname1.wav 等。我该如何实现呢?使用以下我得到错误:

enter image description here

最佳答案

我用 ffmpeg 进行了测试,这很有效:

cmd2 = "ffmpeg -i %s -f segment -segment_time 20 -c copy %s" %(file, fname) + "%09d.wav"
os.system(cmd2)

您将 "%09d.wav"保持原样并将其放在字符串的末尾,在格式之外。

关于python-3.x - 在 Python 3.6 中传递 os.system 调用的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54499529/

相关文章:

python - 使用 moviepy 和 ffmpeg 参数剪辑 webm 文件

python - 您可以直接从数据库中使用 ffmpeg 拆分文件吗?

python - 如何使用 python 和 pygame 在游戏中使用平铺?

regex - 如何减少python正则表达式中的步骤?

python - 在 Python 的 PIL 中渲染波斯语(波斯语)单词

python - 如何在循环内遍历列表

video - 将视频文件转换为等长的图像序列?

Python类: How to check whether an attribute is defined inside __init__ or outside __init__

html - 如何以编程方式捕获 html5 视频( headless )

ruby-on-rails - 如何在ruby中实时解析ffmpeg进度