Linux command
mkvmerge 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Merge files
mkvmerge -o [output.mkv] [input1.mp4] [input2.mp4]
Add subtitles
mkvmerge -o [output.mkv] [video.mkv] [subtitles.srt]
Extract tracks
mkvmerge -o [output.mkv] --audio-tracks [1] [input.mkv]
Set default track flag
mkvmerge -o [output.mkv] --default-track-flag [0:1] [input.mkv]
Split by size
mkvmerge -o [output.mkv] --split [700M] [input.mkv]
Set track language
mkvmerge -o [output.mkv] --language [0:eng] [input.mkv]
Add title
mkvmerge -o [output.mkv] --title "[Movie Title]" [input.mkv]
Identify tracks
mkvmerge -i [input.mkv]
说明
mkvmerge creates Matroska (MKV/MKA/MKS) container files by merging video, audio, and subtitle streams from various source formats. It does not transcode; it only remuxes streams into the Matroska container. The tool is part of MKVToolNix. Track IDs can be found with mkvmerge -i or mkvinfo. Option order matters: global options first, then per-file options before the input file they apply to.
参数
- -o _FILE_
- Output file.
- -i _FILE_
- Identify tracks, codecs, and properties of input file.
- --audio-tracks _IDS_
- Select audio tracks to include.
- --video-tracks _IDS_
- Select video tracks to include.
- --subtitle-tracks _IDS_
- Select subtitle tracks to include.
- --no-audio
- Exclude all audio tracks.
- --no-subtitles
- Exclude all subtitle tracks.
- --language _TID:LANG_
- Set language for a track (ISO 639-2 code).
- --default-track-flag _TID:BOOL_
- Set or clear the default track flag.
- --split _SIZE_|_duration:TIME_|_chapters:all_
- Split output by size, duration, or chapters.
- --title _TEXT_
- Set segment title.
- --append-to _SPEC_
- Append tracks from one file after another.
- -l, --list-types
- List supported source file formats.
FAQ
What is the mkvmerge command used for?
mkvmerge creates Matroska (MKV/MKA/MKS) container files by merging video, audio, and subtitle streams from various source formats. It does not transcode; it only remuxes streams into the Matroska container. The tool is part of MKVToolNix. Track IDs can be found with mkvmerge -i or mkvinfo. Option order matters: global options first, then per-file options before the input file they apply to.
How do I run a basic mkvmerge example?
Run `mkvmerge -o [output.mkv] [input1.mp4] [input2.mp4]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o _FILE_ do in mkvmerge?
Output file.