批量iPod视频编码器
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了批量iPod视频编码器相关的知识,希望对你有一定的参考价值。
A simple python script for taking all files in the base dir and encoding them (and than removing them) into another folder. Handbrake, quality based, ipod nano compatible video, mac or windows.
__author__ = "OtonVM" __date__ = "$Jan 15, 2010 2:18:00 PM$" import sys import os import subprocess import os.path if sys.platform == 'win32': source = r"C:UsersOtonDesktopHandBrake" if os.path.exists(r"C:UsersOtonDesktopHB Out") == False: os.mkdir(r"C:UsersOtonDesktopHB Out") destination = r"C:UsersOtonDesktopHB Out" encoder = sys.path[0] + r' oolshandbrakecliHandBrakeCLI.exe' audioFormat = "faac" if sys.platform == 'darwin': source = r"/Users/Oton/Desktop/Encode" if os.path.exists(r"/Users/Oton/Desktop/HB Out") == False: os.mkdir(r"/Users/Oton/Desktop/HB Out") destination = r"/Users/Oton/Desktop/HB Out" encoder = sys.path[0] + r'/tools/handbrakecli/HandBrakeCLI' audioFormat = "ca_aac" def encode(input, output): for root, dirs, files in os.walk(input): for file in files: (base, ext) = os.path.splitext(file) if ext.lower() == ".avi" or ext.lower() == ".mkv" or ext.lower() == ".mp4" or ext.lower() == ".m4v" or ext.lower() == ".mov": newfile = os.path.join(output, base + ".m4v") infile = os.path.join(root, file) if os.path.exists(newfile): print('Skipping file: ' + infile) else: encode = encoder + ' --encoder x264 --quality 30.0 --audio 1 --aencoder ' + audioFormat + ' --arate 44.1 --mixdown dpl2 --ab 96 --drc 2.0 --format mp4 --ipod-atom --maxHeight 240 --keep-display-aspect --modulus 16 --vfr --x264opts level=30:bframes=0:mbtree=1:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:8x8dct=0:me=umh:no-fast-pskip=1:no-dct-decimate=1:filter=-1,-1:qpmin=16:merange=128:subme=9:mixed-refs=0:trellis=0 --verbose 2' + ' -i "' + infile + '" -o "' + newfile + '"' subprocess.call(encode) os.remove(infile) if __name__ == "__main__": encode(source, destination)
以上是关于批量iPod视频编码器的主要内容,如果未能解决你的问题,请参考以下文章
MPMoviePlayerController 停止 iPod 播放并且不重新启动