2014-03-30 300 views
0

我需要一些python代碼來實現這個功能。我在Ubuntu中安裝了ffmpeg。Python .avi到.mp4

def convert_avi_to_mp4(avi_file.avi): 
    mp4_file = None 
    #some code to do the job 
    return mp4_file 

謝謝

回答

0

你可以做這樣的事情..

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 
相關問題