FFMPEG add chapters entierly through CLI

I had the same need. Apparently there is no easy or any way to add chapters from a chapter file with FFmpeg. For MKV, the tool to use is mkvpropedit. It edits the header only, in seconds. For automatic processing, the media file and the chapter file need the same name and location. You need the MKVToolNix

suite (Windows XP).

set MKVToolNix=
set file=
FOR %%A IN ("%file%") do "%MKVToolNix%mkvpropedit" -c "%%~pnA" %%A&pause