4

我想用 Handbrake 将我的视频从 mkv 转换为 mp4。但我希望将 mkv 中包含的所有音频文件和字幕放入新的 mp4 容器中!

'Add all remaining'我使用 Handbrake 0.9.9 GUI,因为在此版本中,您可以在首选项( / )下预定义默认的音轨和字幕数量'Add all'。现在我想通过 HandBrakeCLI 实现相同的目标。

4

2 回答 2

5

Update: with Version 1.0.4 there are flags for that matter: --all-audio and --all-subtitles. See this link

The -a and --subtitle parameters don't have an option for all tracks, but extra tracks get ignored. So, to append (nearly) all contained audio tracks and subtitles from the source, you can just list more tracks than you'd expect to ever find in a source. The following CLI command does the trick for me.

HandBrakeCLI.exe -i <Path>\Episode01.mkv -o <Path>\Episode01.mp4 --preset Normal 
--subtitle scan,1,2,3,4,5,6,7,8,9,10 -a 1,2,3,4,5,6,7,8,9,10

This CLI command works with the presumption that my source files won't have more than 10 subtitles or audio files. I know that mine don't have more than 4 so I'm sure to include all.

I always use the --preset Normal to convert my videos. It suites my personal needs and came with HandBrake by default :) .The encode log file shows the following CLI command.

CLI Query:  -i "<PATH>\Episode01.mkv" -t 1 --angle 1 -c 1-12 -o "<PATH>\Episode01.mp4"  
-f mp4  -4  -w 720 --loose-anamorphic  --modulus 2 -e x264 -q 20 --vfr -a 1,2 -E faac,faac 
-6 dpl2,dpl2 -R Auto,48 -B 160,160 -D 0,0 --gain 0,0 --audio-fallback ffac3 
--subtitle scan,1,2 --markers="<AppData>\Local\Temp\Episode010-1-chapters.csv" 
--x264-preset=veryfast  --x264-profile=main  --h264-level="4.0"  --verbose=1

This CLI command contains the necessary -i (input) and -o (output) arguments and the rest are defined by --preset Normal

于 2015-01-29T17:34:36.763 回答
2

从 Handbrake 1.0.4 开始,--all-audio--all-subtitles选项允许自动选择所有音频和字幕轨道。

这些可以通过传入一个语言列表来进一步细化(例如,--all-audio --audio-lang-list eng将包括所有英语音轨)。

于 2017-05-24T20:22:55.947 回答