Board logo

标题: [格式转换] 批处理命令行工具转DVD视频为MP4,H264 [打印本页]

作者: hmgl    时间: 2010-3-19 22:08     标题: 批处理命令行工具转DVD视频为MP4,H264

http://handbrake.fr/details.php
作者: BatCoder    时间: 2010-3-19 22:11

是命令行工具么?能否把自带的帮助信息贴出来方便大家查看?
作者: hmgl    时间: 2010-3-23 20:38

是命令行,功能强大,可转ipod,PSP视频,说明太长,贴一部分,其他请看:http://trac.handbrake.fr/wiki/CLIGuide

Using HandBrakeCLI¶HandBrake's CLI is really easy to use. If you get comfortable with it, it can be a lot more efficient than the GUIs.

The Basics¶First, simple input and output.
HandBrakeCLI -i source -o destination That will encode with default values: 1000kbps ffmpeg video and 160kbps AAC audio in an .mp4 container.
Easy, right? So now you can start customizing those settings. You can pile on all sorts of things, and end up with a monster like:
HandBrakeCLI -i /Volumes/MyBook/VIDEO_TS -o /Volumes/MyBook/movie.m4v -v -P -m -E aac,ac3 -e x264-q 0.65 -x ref=3:mixed-refs:bframes=6:b-pyramid=1:weightb=1:analyse=all:8x8dct=1:subme=7:me=umh:merange=24:filter=-2,-2:trellis=1:no-fast-pskip=1:no-dct-decimate=1:direct=auto For now, think about less complex stuff:
HandBrakeCLI -i VIDEO_TS -o movie.mp4 -e x264 -b 2000 -B 192That will encode a source video located at the path VIDEO_TS to an output file called movie.mp4. It will use x264 with a bitrate of 2000 to encode the video, and encode the audio as 128kb/s AAC.
So can you start to see how this works? The most important info for HandBrakeCLI is the location of the DVD, and the location and name where you want to store the encoded video it will output. If you don't specify anything else, it uses fast, low-quality, default values. Each bit of information is preceded by a flag: -i for input, -o for output. To select an encoder, you use -e followed by the encoder name. So -e x264 uses x264 to encode the video. Video bitrate is controlled by -b, and audio bitrate is controlled by -B (yes, the option names are case-sensitive. -b is not -B and -e is not -E).
A few rudimentary hints for using the command line¶
Make sure you remember the right capitalization for everything. At the command line, HandBrakeCLI is not the same as handbrakecli. If you have to type a space in filepath, precede it with a \ backslash so the system knows what's going on.
Presets¶HandBrake offers hard coded, factory-fresh presets that are exactly the same as the built-in presets in the MacGui. Descriptions of presets and rankings for speed, as well as a web-copy of all the presets' CLI strings are available.
To use a preset, type, for example:
./HandBrakeCLI -i /Volumes/DVD -o movie.mp4 --preset="iPhone & iPod Touch" So it's:
--preset="Preset Name"Be careful -- spelling and spacing and capitalization count. Don't forget the quotation marks, either. You can override most preset settings by specifying other options on the command line. To see a list of all the preset names and settings, type:
./HandBrakeCLI --preset-listThe following presets are available:

[ 本帖最后由 hmgl 于 2010-3-23 20:46 编辑 ]
作者: wanfcl83    时间: 2010-6-11 11:49

好东西  支持 楼主 这个好东西 正是我需要的 嘿嘿
作者: jemuillot    时间: 2013-8-10 13:41

高端黑,我自己为了不支持.AAC后缀的iPad也弄了一个批量转的,留贴纪念:

@echo off

cd /d %~dp0
set iroot=%cd%

set path=%iroot%;%path%

set /p src=Source Dir:

cd /d %src%

for /f "delims=" %%i in ('dir /b *.aac') do (
                call :handle "%%i"
)

pause
exit

:handle

set input=%1

REM echo a=%input%


set "input=%input:~1,-1%"

REM echo b="%input%"

set "sname=%input:~0,-4%"
REM echo sn="%sname%"

set "output=%sname%.m4a"
REM echo output="%output%"

mp4box.exe -flat -add "%input%" -new "%output%"

goto :eof




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2