LiouYoung
#coding=utf-8
import getopt
import os
import sys
 
T1 = (\'==============================\n\'
      \'      视频批量压缩工具\n\'
      \'      python xxx.py D:\\ E:\\  .mp4 \'
      \'==============================\n\')
 
inputpath = sys.argv[1]
d_path = sys.argv[2] 
Extensions = sys.argv[3]
 
def run():
    print(T1)
    file_l = os.listdir(inputpath)
    print(file_l)
    for file in file_l:
        global path
        path = os.path.join(inputpath, file)
        if Extensions in file:
            global file_re
            f_path,file_re = os.path.split(file)
            cmd = "ffmpeg.exe -i " + path + " -vcodec h264 -b:v 4096k " + d_path +r"\\"+ file_re + " -y"
			#print(cmd)
            os.system(cmd)
            print("视频:%s 压缩完成"%file_re)
 
if __name__ == "__main__":
    run()

  

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2021-07-08
  • 2021-04-25
  • 2022-02-07
  • 2022-02-10
  • 2021-09-30
  • 2021-11-26
猜你喜欢
  • 2021-11-30
  • 2021-05-29
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案