mp4join is a C/C++ library/utility for joining consecutive MP4/ISOBMFF files that are created with identical configurations. It's useful for merging chaptered video files produced by some cameras.
The operation is performed at the container level, passing through all data tracks losslessly.
It's essentially a C++ port of the Rust library mp4-merge from gyroflow, with no external dependencies.
For end-users, A simple command line tool mp4join is provided.
Usage:
$ mp4join 1.mp4 2.mp4 3.mp4 -o output.mp4It displays progress information while joining the files.
On Windows, you can simply drag & drop input files onto the executable.
Pre-compiled binaries are available at the Release page.
Or grab the latest binaries from GitHub actions:
CMake and C++17-compliant compiler. Git is used to generate optional version info.
Tested on Windows(MSVC, MinGW) and Linux(GCC/Clang).
$ mkdir -p build && cd build
$ cmake -S .. -DCMAKE_BUILD_TYPE=<Release|Debug|...> -DBUILD_SHARED_LIBS=<OFF|ON>
$ cmake --build .Run cpack to create a zip archive containing the library, headers, and the command line utility.
This library offers a simple C-style interface. Refer to mp4join.h.
- Support generic input/output interfaces (e.g.
std::istream). - Handle exotic video files produced by some cameras, e.g. Insta360.
- Support videos with B-frames. The library was originally intended for camera recordings, which typically lack B-frames.
- Tidy the code. While it works, this project was originally written quite a while ago for fun.