Adding chapters to an existing video, recommended method?

This isn’t really a Plex problem but I expect the audience here is likely to contain somebody who will be familiar with the requirement.
I have a number of MP4 concert videos and would like to insert chapter tags at each piece of music. Is there a simple process that will allow me to do this without risking loss of video or audio quality? Handbrake and ffmpeg can’t, unfortunately.
My fallback option is to import the entire MP4 into Shotcut, create chapters, and re-export the video, but I’m not sure how badly that will compromise the original video quality. Maybe it’s fine, but maybe there’s a better tool that can just merge a text chapter spec into an existing video.
I have Windows and Linux available, but not MacOS alas, or I’d be able to use subler.
cheers
T
cheers
T

Add the chapters with MKVtoolnixGUI
The result will be a MKV container, but the difference between mp4 and mkv in Plex is pretty much irrelevant nowadays. The quality won’t change a bit, since MKVtoolnix copies the video and audio streams fom the source file.

Plex will only read chapters from MKV files anyway, AFAIK.

Really?

There used to be a marked difference between performance playing MKV and MP4 on my previous NAS (just an earlier generation of the Synology DS I have now), and I invested a lot of time in VidCoder converting all the MKV to MP4. I still do that with new videos I’m importing too. But if it isn’t a problem any more then that’s going to save me a ton of messing about.

Your last sentence may not be true; I have an MP4 rip of my (Steven Wilson) Home Invasion blu-ray and it definitely has chapters embedded in it.

cheers
T

I’d re-evaluate that out with a few example files with different video, audio, and subtitle codecs in them. Just drag your exisiting mp4 files into MKVtoolnix to quickly remux them to mkv. Then add them into a test library.

That’s good. It may have been a former bug and was fixed without me noticing. Alas, I still don’t know how to add chapters to mp4 files. Subler or mp4box may be able to do that.