Questions tagged «mencoder»

6
使用Python在文件夹中的每个文件上执行命令
我正在尝试创建一个Python脚本,该脚本将: 查看文件夹“ / input” 对于该文件夹中的每个视频,运行一个mencoder命令(以将其转码为我的手机上可播放的内容) mencoder完成运行后,删除原始视频。 这似乎不太难,但是我很讨厌python :) 关于脚本的外观有什么想法? 奖励问题:我应该使用 操作系统 要么 subprocess.call ? Subprocess.call似乎允许使用更具可读性的脚本,因为我可以这样编写命令: cmdLine = ['mencoder',sourceVideo,'-ovc','copy','-oac','copy','-ss','00:02:54','-endpos','00:00: 54”,“-o”,destinationVideo] 编辑:好的,这可行: import os, subprocess bitrate = '100' mencoder = 'C:\\Program Files\\_utilitaires\\MPlayer-1.0rc2\\mencoder.exe' inputdir = 'C:\\Documents and Settings\\Administrator\\Desktop\\input' outputdir = 'C:\\Documents and Settings\\Administrator\\Desktop\\output' for fichier in os.listdir(inputdir): print 'fichier :' + fichier sourceVideo …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.