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_file = os.path.join(output_folder, os.path.splitext(filename)[0].replace('00', '-', 1) + '.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/nBp5 著作权归作者所有。请勿转载和采集!