MMH: How to Create CUE files for MKV files

QuadraphonicQuad

Help Support QuadraphonicQuad:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

HomerJAU

Moderator: MCH Media Players
Staff member
Moderator
Moderator
Joined
Jun 13, 2013
Messages
5,930
Location
Melbourne, Australia
Music Media Helper 4.1.4 can now create a CUE file from MKV files with chapters:

EDITED 2021-4-18: Updated screen grabs & added 'Changing the Default Audio stream'

Getting Chapter Titles from MusicBrainz:

Use the MMH tool: MKV Chapter Editor (from 'Edit Chapters in MKV' on the MMH Launcher dialog)

This will load a list of the MKV file's chapters.

To get chapter names from MusicBrainz, first load the MKV into the dialog

NOTE: Only music albums and concert data is available on MusicBrainz. Ignore this section for MKV movies.

The next screen shot shows the MKV Edit dialog after a file with chapters is loaded:
ChapterTagging1.PNG


Click: ‘Get Titles from MusicBrainz’

The MMH Musicbrainz Tagger pops up (only top of dialog shown in next screen shot)

Enter the Album Artist and Album Name (For Concert videos enter the release title):
ChapterTagging2.PNG


Click: ‘Find’

If the Artist name is unique MMH will attempt to download matching releases from the MusicBrainz database. If there are multiple artists with same names you will need to select the artist to use.

If the Artist and Album names match a release(s) you will see dialog populated with release data:
ChapterTagging3.PNG


Find the desired release from the Releases list box and select it. The Track List will be populated from the selected release. If the release has multiple discs (e.g. a CD and a DVD or Blu-ray or two DVDs etc) the Discs list is shown with a list of its discs. Select the desired disc to see the disc’s tracks. If the release has only one disc, no disc list is displayed and the track list is populated for that disc.

Click: ‘Copy Tags’ to copy the Track List to the MKV Chapter Editor dialog

HINT: Often concert video discs (both BDV and DVD) will have short intro chapters and/or short outro chapters. Copying the tags may mean the tracks list is not correctly aligned in the Chapter Editor’s grid. If this is the case you can use ‘Copy Track Titles to Edit’. This feature allows you to add new track titles, remove them and even change the names. When you save that edited list it copies the new track list back to MusicBrainz dialog, overwriting the track list found in Musicbrainz.

You will now see the track titles in the Chapter Editor:
ChapterTagging4.PNG


There are two main options moving forward:

Click: ‘Save’ to save the New Name to the Chapter names in the MKV (the dialog will exit)

Or

Click: ‘Save Cue’ to create a CUE file for the MKV selected with the chapter titles included.


Changing the Default Audio Stream:
When an MKV with multiple audio streams is played its Default Audio Stream is played. Often Blu-rays are authored with the stereo track as the Default stream. For surround enthusiasts wanting to hear a surround stream it is recommended you change the Default to your preferred surround stream (e.g. Atmos if you have an Atmos system or DTS-HDMA 5.1 for lossless audio etc)

To change the Default audio stream:

Click: 'Audio Streams' from the toolbar and the Audio Stream selection dialog shows:
SplitRename3.PNG


Select the audio stream to set as the default stream and click 'Select' (or double-click on the stream to select)


Saving a CUE file:

If you save a Cue file, MMH will pop up a dialog to collect further data about the album or concert release:
ChapterTagging5.PNG


If you have just fetched data from Musicbrainz this dialog will be pre-filled with this data (as above). If you have not used Musicbrainz or the search found nothing you will need to enter this data which will be saved to the CUE file.

Click: Save to create the CUE file

Copy your original MKV file and the new CUE file to your final playback folder.

Done.

In JRiver, importing the new folder with the MKV and its CUE file will add the album and all it’s tracks to the JRiver Audio Library:
MKVwithCUEinFolder.PNG


The CUE file is used by JRiver to load the track tags:
MKVwithCUEinJRiver1.PNG
 
Last edited:
Garry,
Great stuff here.
1) Since you are not advocating extracting chapters from an MKV ("extract audio from MKV" where the Atmos stream can be chosen) I assume it is more important to carefully rip the BDA (in MakeMKV, for example) to the correct audio stream, and that one alone? Is there a rule of thumb for Atmos, because MakeMKV is not forthcoming?
2) If the above is true then those of us who ALSO want a good 5.1 stream should repeat the process, this time with one MKV for 5.1?
3) I assume, in the above, when you have a choice for cue file or saving the new names in the chpaters, going the cue route is the only way the album will end up in JRivers audio library; otherwise tagged MKV chapters will show in Jrivers video library?
thx
Ted
P.S. Still a no-go with me after Beta 3 and updating .net I'll work on this further, but no idea right now. :(
 
1) Since you are not advocating extracting chapters from an MKV ("extrcat audio from MKV" where the Atmos stream can be chosen) I assume it is more important to rip the BDA (in MakeMKV, for example) to the correct audio stream, and that one alone? Is there a rule of thumb for Atmos, because MakeMKV is not forthcoming?

At the moment to get Atmos to playback in both JRiver and Kodi from an MKV is to have the MKV with just the Atmos stream or the Atmos stream set to the Default stream. I'll look at adding a new command to allow users to set any audio stream to the default. That way an 'MKV backup' (containing all streams is all you need to create with MakeMKV.

2) If the above is true then those of us who ALSO want a good 5.1 stream should repeat the process, this time with one MKV for 5.1?

Again, at the moment, its true.

3) I assume, in the above, when you have a choice for cue file or saving the new names in the chpaters, going the cue route is the only way the album will end up in JRivers audio library; otherwise tagged MKV chapters will show in Jrivers video library?

Correct. For me I'd prefer my albums to be in the Audio Library. For Concerts in the Video library (so pick your method)

P.S. Still a no-go with me after Beta 3 and updating .net I'll work on this further, but no idea right now.

You are the only user reporting MusicBrainz tagging failing with MMH. I think its a Windows 7 SP1 issue as there's probably not many users still on 7.
 
Yes, and this is only my office desktop/tower, not the long term JRiver computer. Note: it is weird that tagging is my strength, that MP3tag still works fine on this old beauty, and that currently Roon resides on it, too, and does fine. No ideas here.

Anyway....So until my new server is built (or I use my current server, Win10, which is HQPlayer only, and currently for my RAAL setup) I'll bow out of testing beta MMHs. So forget about my issues for now...thx for all the help regardless.
 
What track change options should be checked? I am getting fading from one track to another with only, Switch Tracks, "gapless" checked?

The same MKV in the video section without cue isn't affected.
 
View attachment 64991
This is what I have set.

I tried that too. Strange. It is chopping the last 2 seconds of a track with a fade into the next. Tested with both Abbey Road and INXS Kick. I am using an older jRiver version or I am overlooking a setting.

Looks much better in the "Audio" view, hopefully I can figure it out...
 
I get gapless with flac files but cue+mkv cuts the last few seconds off the end of every track. Older version of jRiver is probably the culprit.
 
I loaded MMH onto my wife's laptop and voila, got it working properly. Then brough the hdd back to this MC27 computer and ran Abbey Road in 3 versions:
1) cue file from MKV, audio library: a get existing track fade out while next track starts, a sort of smeared gapless. Not good. But audio track change settings combination may solve this. I tried changing mine and every combo got worse.
2) separate MKV chapters in Video library: slightly better but a 2 second pause between tracks, but little if any cut offs. Seems like Jriver is loading a new video menu slide.
3) single MKV file in Video library: gapless. Perfect. Expected as much, as it's one file.

I was hoping option 2 would work, and there doesn't seem to be analogy to gapless in the video settings.

Edited above
The gapless checks are being done with Mean Mr Mustard -> Polythene Pam
 
Last edited:
I loaded MMH onto my wife's laptop and voila, got it working properly. Then brough the hdd back to this MC27 computer and ran Abbey Road in 3 versions:
1) cue file from MKV, audio library: a get existing track fade out while next track starts, a sort of smeared gapless. Not good. But audio track change settings combination may solve this. I tried changing mine and every combo got worse.
2) separate MKV chapters in Video library: slightly better but a 2 second pause between tracks, but little if any cut offs. Seems like Jriver is loading a new video menu slide.
3) single MKV file in Video library: gapless. Perfect. Expected as much, as it's one file.

I was hoping option 2 would work, and there doesn't seem to be analogy to gapless in the video settings.

Edited above
The gapless checks are being done with Mean Mr Mustard -> Polythene Pam

Thanks. I have the same experience with the 3 abbey road versions (and Kick).

The other issue I have, although more minor, is clicking the ignore "The" box doesn't seem to do anything and bands like The Beatles get sorted by "T"he and not "B"eatles.
 
I wrote a utility to directly convert an MKV file's chapters into a CUE file, and have been using it successfully for years. The resulting CUE sheet can be edited for track names and meta data in a text editor, and then loaded into foobar2000. From there you can split a FLAC or WAV into separate tracks.

mkv2cue is written in PHP and can be run from the command line, or you can just use the included Windows executable. The PHP source can be run using PHP, and compiled into an executable on any platform. You might also want to see the source code if you're concerned about viruses, since you can quickly see it's not doing much beside reading a file, converting the time formats, and writing to the output.

Here are both the EXE and the PHP source: https://embernet.com/mkv2cue/mkv2cue.zip
 
Ran it (with mkv, .exe and .php in same directory) but got ["mkvextract not found"]. Win7 SP1.
OMG, sorry! It's been so long, I forgot my code depends on the excellent MKVToolNix set of MKV processing utilities... Which you probably want to have around anyway.

Also... You don't need to keep the mkv2cue.php file if you're using the executable.
 
This will be great for MAC users. Thanks for sharing.
I'm glad to hear.

Still... it's more complex on a Mac, since I only provide a Windows executable. Mac users will have to install PHP, if only for its command line interface (CLI). Now, if someone could make a standalone executable for the Mac like I've done for Windows, that would be ideal. I wonder if this tool could help: webfashionist/nightrain-ep
 
I installed MKVToolNix but still same response; it doesn't find mkvextract. Prolly user error on my part.

My goal is to compare your cue file with the one MMH created, to see if yours plays back gaplessly/seamlessly. It's a first world problem, cuz I can simply play back the single MKV file. (y)
 
Now, if someone could make a standalone executable for the Mac like I've done for Windows, that would be ideal. I wonder if this tool could help: webfashionist/nightrain-ep

Thanks again. Looks interesting. I could give it a go. Does it look like your PHP is compatible with nightrain? (I know nothing about PHP coding)
 
I installed MKVToolNix but still same response; it doesn't find mkvextract. Prolly user error on my part.

My goal is to compare your cue file with the one MMH created, to see if yours plays back gaplessly/seamlessly. It's a first world problem, cuz I can simply play back the single MKV file. (y)
Putting mkv2cue in the same folder as mkvextract.exe should work, but that's a little crude. Where exactly is your mkvextract.exe located? mkv2cue looks in the local folder, the PATH folders, then C:\Program Files (x86)\MKVToolNix\mkvextract.exe, and finally C:\Program Files\MKVToolNix\mkvextract.exe
 
Back
Top