Add chapters to video files based on a track list.
Example showing song chapters in a video file in the app IINA:
Your tracklist should be a plain text file (.txt) where each line specifies a chapter with its start time and title in the specified format, hours are optional.
MM:SS Chapter Title
HH:MM:SS Chapter Title
0:47 This is the first chapter
3:15 This is the second chapter
1:06:22 This is the third and last chapter
To add chapters to your MP4 file, use the following command syntax:
node chapmunx.mjs [options]
-i, --inputFile <inputFile>
: Specify the input video file (.mp4). This option is required.-t, --trackList <trackList>
: Specify the tracklist file (.txt). Will default to input filename but with txt extension.-d, --dryRun
: Run the command in dry run mode without making any changes.-v, --verbose
: Enable verbose logging for detailed output.
node chapmunx.mjs -i path/to/your/video.mp4
Terry Butler created a guide on how to create chapters here.
This will generate a test MP4 file:
ffmpeg -f lavfi -i color=c=red@0.2:duration=360:s=1280x720:r=10 ./test/testinput.mp4
To test the chapmunx
functionality:
node src/chapmunx.mjs -i test/testinput.mp4 -t test/tracklist.txt