![](/img/trans.png)
[英]Is there a python package to Read and update metadata from AVI, MP4 and MKV?
[英]Python .avi to .mp4
这个函数我需要一些python代码。 我已经在 Ubuntu 中安装了 ffmpeg。
def convert_avi_to_mp4(avi_file.avi):
mp4_file = None
#some code to do the job
return mp4_file
谢谢
你可以做这样的事情..
import os
def convert_avi_to_mp4(avi_file_path, output_name):
os.popen("ffmpeg -i '{input}' -ac 2 -b:v 2000k -c:a aac -c:v libx264 -b:a 160k -vprofile high -bf 0 -strict experimental -f mp4 '{output}.mp4'".format(input = avi_file_path, output = output_name))
return True
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.