I have been using MKVToolNix for a long time, but there appears to be 1 limitation that I can’t find a workaround - it cannot split a video file containing HEVC track.
I have explored all the splitting modes available, and all yielded the same error:
--- Errors emitted by job 'Multiplexing to file "ABC (1).mkv" in directory "/mnt/ABCXYZ"' started on 2025-03-05 06:00:40 +08:00 ---
The track ID 1 from the file '/mnt/ABCXYZ/ABC.mkv' cannot be split. Splitting tracks of this type is not supported.
So, I’m looking for an alternative to MKVToolNix to split such video files (which contains HEVC track), without re-encoding any track.
mkvtoolnix-gui depends on qt6-multimedia, which depends on qt6-multimedia-backend (which is also known as qt6-multimedia-ffmpeg), and that depends on ffmpeg.
Strangely though, mkvtoolnix-cli doesn’t seem to depend on ffmpeg (or any other app which requires ffmpeg) - it uses the individual libraries such as libmatroska, libvorbis etc:
pamac info mkvtoolnix-cli
Name : mkvtoolnix-cli
Version : 89.0-3
Description : Set of tools to create, edit and inspect Matroska files
URL : https://mkvtoolnix.download/
Licenses : GPL2
Repository : extra
Installed Size : 20.4 MB
Groups : --
Depends On : boost-libs gcc-libs glibc libebml.so=5-64 libfmt.so=11-64 libmatroska.so=7-64 pugixml qt6-base libdvdread
libFLAC.so=14-64 libogg.so=0-64 libvorbis.so=0-64 zlib
Optional Dependencies : --
Provides : --
Replaces : --
Conflicts With : --
Packager : Christian Heusel <gromit@archlinux.org>
Build Date : Thu 20 Feb 2025 21:01:34
Validated By : MD5 Sum SHA-256 Sum Signature
I dunno. It doesn’t seem to use any HEVC/H265 libraries, so it may not be able to process those files. I guess the best way to find out is to install it.
I recall there was some chatter about adding FLAC encoding to Avidemux, in 2023; it was apparently on their “to do” list; but, I can’t say whether it’s currently supported.
If it isn’t, you can always re-encode the audio to a supported lossless codec with ffmpeg before you process it with Avidemux, something like;
And then split it in copy mode with Avidemux (keeping an MKV container). When finished, you could then convert it to MKV/FLAC again, if FLAC audio is absolutely needed;
I just tried the same command on an .mkv file and it worked. Were you running the command from within the directory? Or, as mkv is a container, maybe the video is encoded in a format that mkvmerge cannot read?
The video is HEVC.
The audio is FLAC 2.0.
The subtitle is PGS.
MKVToolNix GUI can perform normal remux operation, as long as splitting is not involved.
And that is why I attempted the CLI, in the hope that it can bypass the issue.
I played with kdenlive years ago, and I have an impression that it did not support remux.
Following your recommendation, I tried it again, and it does support splitting HEVC and FLAC now.
The final output is kinda messy, and it also removed some metadata of the tracks.
Its UI is kinda complicated, and I ended up using its CLI command.
And the CLI is based on ffmpeg…
(which made me wonder: If I use ffmpeg earlier, then I would have settled the issue earlier?)