Python3 脚本优化:修改 MP4 文件输出文件名,仅从英文开始
import os import subprocess
folder_path = r'E:\home\up' output_folder = r'E:\home\up'
for filename in os.listdir(folder_path): if filename.endswith('.mp4'): input_file = os.path.join(folder_path, filename) output_name = filename.upper().replace('00', '-', 1) output_name = ''.join(filter(str.isalpha, output_name)) output_file = os.path.join(output_folder, output_name + '.mp4') cmd = ['ffmpeg', '-i', input_file, '-empty_hdlr_name', '1', '-metadata:s:v:0', 'language=jpn', '-metadata:s:a:0', 'language=jpn', '-c', 'copy', '-disposition:v:1', 'attached_pic', output_file] subprocess.run(cmd, check=True)
原文地址: https://www.cveoy.top/t/topic/nBp4 著作权归作者所有。请勿转载和采集!