HandBrakeCLI.exe
動画を変換する
.isoから直接チャプター選択が可能
http://osdn.dl.sourceforge.jp/handbrake-jp/45294/HandBrake-0.9.4jp-r2-Win_GUI.exe
http://osdn.dl.sourceforge.jp/handbrake-jp/45294/45293/HandBrake-0.9.4-Win_CLI.zip
GUI https://handbrake.fr/downloads.php
CLI https://handbrake.fr/downloads2.php
旧版 https://handbrake.fr/old.php
毎晩 https://handbrake.fr/nightly.php
HandBrake 解説 @Wiki - HandBrakeCLI 解説
http://www57.atwiki.jp/handbrakeguide/pages/34.html
exe単体では動かず
必要な物(同梱)
libgcc_s_sjlj-1.dll
Handbrake.exe
user_presets.xmlのCategoryタグは無視される
"C:\Program Files\Handbrake\HandBrakeCLI.exe" -i "%~1" -t 1 -c 1 -o "%~n1.mp4" -f mp4 -w 480 -l 270 --crop 0:0:0:0 -e x264 -q 20 -a 1 -E faac -6 dpl2 -R 48 -B 128 -D 0.0 -x cabac=0:ref=2:me=umh:bframes=0:subq=6:8x8dct=0:trellis=0:weightb=0 -C Automatic -v 1
-i 入力ファイル
-t 1 タイトル番号
-c 1 章番号
-o 出力ファイル
-f mp4 出力形式
-X 480 幅
-l 270 高さ
-e x264 動画形式
-q 20 質
-a 1 音声番号
-E faac 音声形式
-6 dpl2 音声チャンネル
-R 48 音声サンプルレート
-B 128 音声ビットレート
-D 0.0 Apply extra dynamic range compression to the audio,
-x cabac=0:ref=2:me=umh:bframes=0:subq=6:8x8dct=0:trellis=0:weightb=0 x264詳細設定
-C Automatic CPU数の指定
-v 1 詳細表示
DVD-VIDEO
-t0 -v? 出力サイズ順
-v0 時刻表示行が無い
-t0のみ
-v
-v1
-v2 scan: preview ~が追加
-v3 標準出力で、Part of Title Track search pointer table等追加
-v4~10 -v2と同等?
Scanning title ~ of ~...行は、抜ける部分が実行毎に変化する
2>&1|findstr chap ~
[時:分:秒] scan: chap 1 c=0->0, b=~->~ (~), 851543 ms
~が同じchapは同じ動画
変換中のコマンド
Commands:
[h]elp これを表示
[q]uit HandBrakeCLIの終了
[p]ause 変換を一時停止
[r]esume 変換を再開
例: HandBrakeCLI [options] -i 入力機器 -o 出力ファイル
### General Handbrake Options------------------------------------------------
-h, --help ヘルプ表示
-u, --update 更新確認し終了
-v, --verbose <#> 詳細表示 (追加引数: 記録レベル)
-C, --cpu CPU数の指定 (既定値: 自動検知)
-Z. --preset <string> プリセットを使用する
Use a built-in preset. Capitalization matters, and
if the preset name has spaces, surround it with
double quotation marks
-z, --preset-list See a list of available built-in presets
--no-dvdnav Do not use dvdnav for reading DVDs
(experimental, enabled by 既定値 for testing)
### Source Options-----------------------------------------------------------
-i, --input <string> 入力機器の指定
-t, --タイトル <number> エンコードするタイトルの選択 (0 走査のみ, 既定値: 1)
-L, --longest 一番長いタイトルを選択
-c, --chapters <string> 複数章を選択 (例. "1-3" 1~3章, "3" 3章 のみ, 既定値: 全章)
--angle <number> DVD アングルの選択
--previews <#:B> Select how many preview images are generated (max 30),
and whether or not they're stored to disk (0 or 1).
(既定値: 10:0)
--start-at-preview <#> Start encoding at a given preview.
--stop-at <unit:#> Stop encoding at a given frame, duration (in seconds),
or pts (on a 90kHz clock)
### Destination Options------------------------------------------------------
-o, --output <string> 出力ファイル名の指定
-f, --format <string> 出力フォーマットの指定 (mp4/mkv, 既定値:ファイル名から自動検知)
-m, --markers Add 章 markers (mp4 and mkv output フォーマットs only)
-4, --large-file Use 64-bit mp4 files that can hold more than
4 GB. Note: Breaks iPod, PS3 compatibility.
-O, --optimize Optimize mp4 files for HTTP streaming
-I, --ipod-atom Mark mp4 files so 5.5G iPods will accept them
### Video Options------------------------------------------------------------
-e, --encoder <string> Set video library エンコードr (ffmpeg,x264,theora)
(既定値: ffmpeg)
-x, --x264opts <string> Specify advanced x264 options in the
same style as mencoder:
option1=value1:option2=value2
-q, --quality <float> 動画の質を指定 (0.0..1.0)
-S, --size <MB> 対象のサイズを指定
-b, --vb <kb/s> 動画のビットレートを指定 (既定値: 1000)
-2, --two-pass Use two-pass mode
-T, --turbo When using 2-pass use the turbo options
on the first pass to improve speed
(only works with x264, affects PSNR by about 0.05dB,
and increases first pass speed two to four times)
-r, --rate Set video framerate (5/10/12/15/23.976/24/25/29.97)
Be aware that not specifying a framerate lets
HandBrake preserve a source's time stamps,
potentially creating variable framerate video
--vfr, --cfr, --pfr Select variable, constant or peak-limited
frame rate control. VFR preserves the source
timing. CFR makes the output constant rate at
the rate given by the -r flag (or the source's
average rate if no -r is given). PFR doesn't
allow the rate to go over the rate specified
with the -r flag but won't change the source
timing if it's below that rate.
If none of these flags are given, the 既定値
is --cfr when -r is given and --vfr otherwise
### Audio Options-----------------------------------------------------------
-a, --audio <string> Select audio track(s), separated by commas
More than one output track can be used for one input.
("none" for no audio, "1,2,3" for multiple tracks, 既定値: 最初の1つ)
-E, --aencoder <string> Audio エンコードr(s) (faac/lame/vorbis/ac3/dts)
ac3 and dts meaning passthrough
Separated by commas for more than one audio track.
(既定値: guessed)
-B, --ab <kb/s> Set audio bitrate(s) (既定値: 160)
Separated by commas for more than one audio track.
-6, --mixdown <string> フォーマット(s) for surround sound downmixing
Separated by commas for more than one audio track.
(mono/stereo/dpl1/dpl2/6ch, 既定値: dpl2)
-R, --arate Set audio samplerate(s) (22.05/24/32/44.1/48 kHz)
Separated by commas for more than one audio track.
-D, --drc <float> Apply extra dynamic range compression to the audio,
making soft sounds louder. Range is 1.0 to 4.0
(too loud), with 1.5 - 2.5 being a useful range.
Separated by commas for more than one audio track.
-A, --aname <string> Audio track name(s),
Separated by commas for more than one audio track.
### Picture Settings---------------------------------------------------------
-w, --width <number> 画像幅の指定
-l, --height <number> 画像高の指定
--crop <T:B:L:R> 切り抜き値の指定 (既定値: 自動切り抜き)
-Y, --maxHeight <#> 最大画像高の指定
-X, --maxWidth <#> 最大画像幅の指定
--strict-anamorphic 動画のアスペクト比を維持する
--loose-anamorphic 指定した幅でアスペクト比を維持する
--custom-anamorphic 動画のアスペクト比を維持し、直接、全パラメータを制御する
--display-width Set the width to scale the actual pixels to
<number> at playback, for custom anamorphic.
--keep-display-aspect Preserve the source's display aspect ratio
when using custom anamorphic
--pixel-aspect Set a custom pixel aspect for custom anamorphic
<PARX:PARY>
(--display-width and --pixel-aspect are mutually
exclusive and the former will override the latter)
--itu-par Use wider, ITU pixel aspect values for loose and
custom anamorphic, useful with underscanned sources
--modulus Set the number you want the scaled pixel dimensions
<number> to divide cleanly by, for loose and custom
anamorphic modes (既定値: 16)
-M --color-matrix Set the color space signaled by the output
<601 or 709> (Bt.601 is mostly for SD content, Bt.709 for HD,
既定値: set by resolution)
### Filters---------------------------------------------------------
-d, --deinterlace Deinterlace video with yadif/mcdeint filter
<YM:FD:MM:QP> (既定値 0:-1:-1:1)
or
<fast/slow/slower>
-5, --decomb Selectively deinterlaces when it detects combing
<MO:ME:MT:ST:BT:BX:BY:MG:VA:LA:DI:ER:NO:MD:PP:FD>
(既定値: 7:2:6:9:80:16:16:10:20:20:4:2:50:24:1:-1)
-9, --detelecine Detelecine (ivtc) video with pullup filter
Note: this filter drops duplicate frames to
restore the pre-telecine framerate, unless you
specify a constant framerate (--rate 29.97)
<L:R:T:B:SB:MP:FD> (既定値 1:1:4:4:0:0:-1)
-8, --denoise Denoise video with hqdn3d filter
<SL:SC:TL:TC> (既定値 4:3:6:4.5)
or
<weak/medium/strong>
-7, --deblock Deblock video with pp7 filter
<QP:M> (既定値 5:2)
-g, --grayscale Grayscale encoding
### Subタイトル Options------------------------------------------------------------
-s, --subタイトル <string> Select subタイトル track(s), separated by commas
More than one output track can be used for one
input.
("1,2,3" for multiple tracks.
A special track name "scan" adds an extra 1st pass.
This extra pass scans subタイトルs matching the
language of the first audio or the language
selected by --native-language.
The one that's only used 10 percent of the time
or less is selected. This should locate subタイトルs
for short foreign language segments. Best used in
conjunction with --subタイトル-forced.
-F, --subtitle-forced Only display subタイトルs from the selected stream if
<string> the subタイトル has the forced flag set. May be used in
conjunction with "scan" track to auto-select
a stream if it contains forced subタイトルs.
Separated by commas for more than one audio track.
("1,2,3" for multiple tracks.
If "string" is omitted, the first trac is forced.
--subtitle-burn "Burn" the selected subタイトル into the video track
<number> If "number" is omitted, the first trac is burned.
--subtitle-default Flag the selected subタイトル as the default subタイトル
<number> to be displayed upon playback. Setting no default
means no subタイトル will be automatically displayed
If "number" is omitted, the first trac is default.
-N, --native-language Specifiy the your language preference. When the first
<string> audio track does not match your native language then
select the first subタイトル that does. When used in
conjunction with --native-dub the audio track is
changed in preference to subタイトルs. Provide the
language's iso639-2 code (fre, eng, spa, dut, et cetera)
--native-dub Used in conjunction with --native-language
requests that if no audio tracks are selected the
default selected audio track will be the first one
that matches the --native-language. If there are no
matching audio tracks then the first matching
subタイトル track is used instead.
--srt-file <string> SubRip SRT filename(s), separated by commas.
--srt-codeset Character codeset(s) that the SRT file(s) are
<string> エンコードd in, separted by commas.
Use 'iconv -l' for a list of valid
codesets. If not specified latin1 is assumed
--srt-offset Offset in milli-seconds to apply to the SRT file(s)
<string> separted by commas. If not specified zero is assumed.
Offsets may be negative.
--srt-lang <string> Language as an iso639-2 code fra, eng, spa et cetera)
for the SRT file(s) separated by commas. If not specified
then 'und' is used.
--srt-default Flag the selected srt as the default subタイトル
<number> to be displayed upon playback. Setting no default
means no subタイトル will be automatically displayed
If "number" is omitted, the first srt is default.
"number" is an 1 based index into the srt-file list
---iso2chap.bat---
@if exist "%~1" @goto :ext
@echo .isoからタイトル・チャプター毎に変換するバッチを生成
@goto :eof
:ext
@setlocal
@set cli=C:\Program Files\Handbrake\HandBrakeCLI.exe
@set opt= -f mp4 -w 360 -l 240 --crop 0:0:0:0 -e x264 -q 20 -a 1 -E faac -6 dpl2 -R 48 -B 128 -D 0.0 -x cabac=0:ref=2:me=umh:bframes=0:subq=6:8x8dct=0:trellis=0:weightb=0 -C Automatic -v 1
@set inp=%~1
@set out=%~n1_%%t-%%c.mp4
@set out=%%t-%%c %~n1.mp4
@set bat=%~nx1.bat
@"%cli%" -i "%~1" -t0 -v 2>iso.info
:findstr /R /C:"has [0-9]* chapters" iso.info
@copy nul "%bat%">nul
@for /f "usebackq tokens=4,6" %%t in (`findstr chapters iso.info`) do @for /l %%c in (1,1,%%u) do @echo "%cli%" -i "%inp%" -t %%t -c %%c -o "%out%" %opt% >> "%bat%"
@move iso.info "%bat%\..\%~nx1.info"
@if exist "%~2" shift &@goto :ext
@goto :eof
------------------
最終更新:2015年06月29日 21:29