Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th May 2021, 00:06   #1061  |  Link
Perenista
Registered User
 
Join Date: Oct 2013
Posts: 205
I am having a new problem with MKVToolnix and subtitles.

https://i.postimg.cc/QtvWbwDS/X1.png

https://i.postimg.cc/brbSFgNP/X2.png

Whenever I add one of these subtitles to any of these Matroskas MKVTOOLNIX disregard my advice to tell all of them are english, and somehow interprets the "de" among the words means it should be german.



There's just one problem here, the words "de" are part of "cor-de-rosa" which means "pink color" in portuguese.

The mistake MKVToolnix is making would be similar to telling me this:

The Adventures.mkv
The Adventures.srt

Would result in this:



Since this is a primary mistake I need to disable this for good. Whatever language I said the program to assume it is (in this case english) needs to be the one attributed to ALL subtitles. No matter what.
Perenista is offline   Reply With Quote
Old 10th May 2021, 13:04   #1062  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
You can configure the languages the GUI tries to find in the file name in the preferences ("Multiplexer" → "Deriving track languages"). Just remove all languages safe for those you usually use.

If you don't want dashes to be recognized as valid separators for words for the purpose of deriving track languages, you can simply remove the dash from the list of boundary characters there, too.

Or simply deactivate that feature altogether, again at the same place.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 20th May 2021, 11:29   #1063  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 629
Hi Mosu,

I noticed you opened https://gitlab.com/mbunkus/mkvtoolnix/-/issues/3113 recently.
For my reassurance, two questions please.

With the "no support for DV two separate files" in your last post there, I assume you mean when importing previously demuxed BL and EL streams?
Secondly, am I right to think that using v55.0.0 is - for now - recommended for (re-)muxing Dolby Vision?
von Suppé is offline   Reply With Quote
Old 20th May 2021, 11:47   #1064  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by von Suppé View Post
With the "no support for DV two separate files" in your last post there, I assume you mean when importing previously demuxed BL and EL streams?
I don' t know the verbiage around Dolby Vision, so I cannot really say with certainty that this is what I meant. If I understood things correctly, Dolby Vision on Blu-rays is packaged in a way that means the player has to read the regular HEVC data from one file and the Dolby Vision data from another file, as opposed to having both in a single file. I will most likely not support the former (at least not initially or anytime soon).

Quote:
Originally Posted by von Suppé View Post
Secondly, am I right to think that using v55.0.0 is - for now - recommended for (re-)muxing Dolby Vision?
You can also use 56.1.0. If the resulting file works, great; so far I don't have concrete evidence that all files containing DV created by ≥ 56.1.0 show playback issues.

If it doesn't, try adding "--engage dont_normalize_parameter_sets" which is basically the same behavior as in versions prior to v56.

Even better would be if you could follow issue 3093 and give the test files I upload there a try & give feedback on whether they play fine or not. That would actually help in fixing the bug whereas going back to v55 doesn't help me at all.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 20th May 2021, 13:50   #1065  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Addendum: I've just realized that mkvmerge ≥ v56 places the Dolby Vision NALUs in the wrong Matroska block, even if "--engage dont_normalize_parameter_sets" is used. Therefore yes, at this point using v55 for Dolby Vision is the way to go until I've fixed that. You can follow issue 2784 where this is currently discussed.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 22nd May 2021, 12:20   #1066  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
MKVToolNix v57.0.0 released

Hello, hello!

fresh of the presses here's MKVToolNix v57.0.0. A lot of work has gone into the HEVC/H.265 code over the last couple days, fixing most issues with Dolby Vision and HDR content, but also fixing a couple of general issues with the HEVC/H.265 code. Everyone using that codec should definitely update.

The state of Dolby Vision & HDR is pretty good right now. The only thing still missing is reading Dolby Vision from Annex B type elementary streams (raw .h265 files or MPEG transport streams), but we're working on that as well.

By the way: a lot of you have decided to support MKVToolNix by buying it from the Microsoft Store for which I'm very, very grateful. At the point of writing it has been sold 544 times already. One immediate benefit is that I've invested in Dolby Vision capable hardware in order to be better able to test & improve that part of MKVToolNix. Your support is definitely making a difference.

Here are the usual links: the MKVToolNix home page, the Windows installer/portable version & macOS DMG & Linux AppImage and the source code.

The Windows and macOS binaries as well as the Linux AppImage are available already. The other Linux binaries are still being built and will be available over the course of the next couple of hours.

Here are the NEWS since the previous release:

Version 57.0.0 "Till The End" 2021-05-22
New features and enhancements
  • mkvmerge: MP4 reader: added support for reading Dolby Vision from MP4 files (FourCCs "dvh1" and "dvhe"; configuration records "dvcC", "dvvC" and "hvcE" will be converted into block addition mappings). Implements #2784.
  • mkvmerge: SRT subtitles: mkvmerge now accepts empty text files with the extension ".srt" as SRT subtitle files, enabling the creation of empty SRT tracks. Implements #3089.
  • mkvmerge, mkvextract: HEVC/H.265: access unit delimiter NALUs will no longer be discarded, neither during muxing nor during extraction.
  • MKVToolNix GUI: preferences: switched the order & wording of controls in the "enabling items" panel to make it clearer that certain controls define exceptions. Inspired by 3086.

Bug fixes
  • mkvmerge: HEVC/H.265 parser: several NALU types, notably the Dolby Vision-specific NALUs ("unspecified 62" and "unspecified 63") and suffix SEI NALUs, are now stored with the frame they belong to instead of with the next frame. Part of fixing & implementing #2784, #2818, #3093 and #3113.
  • mkvmerge: HEVC/H.265 packetizer: fixed setting the track's default duration when reading HEVC/H.265 from Matroska files that don't have a default duration set.
  • mkvmerge: HEVC/H.265 packetizer: fixed the calculation of the duration of frames so that "SimpleBlock" elements can be used again instead of "BlockGroups" with "BlockDuration" elements. Fixes #3114.
  • mkvmerge, mkvextract: HEVC/H.265 parser: fixed issues with ordering & duplication of certain NALUs (parameter set & prefix SEI NALUs). Part of fixing & implementing of #2784, #2818, #3093 and #3113.
  • MKVToolNix GUI: multiplexer: when dragging & dropping files to the multiplexer, the source directory will be remembered as the "last open directory" again, causing subsequent uses of the "open file" dialog to start in the same directory. Fixes #3110.
  • mkvinfo: fixed the position of frames in block groups containing "block duration" elements in summary mode (e.g. for subtitle tracks).

Build system changes
  • "configure" will now try to detect "libmagic" via "pkg-config" and fall back to including & linking directly if it cannot be found via "pkg-config".

Have fun
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 22nd May 2021, 14:30   #1067  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Quote:
Originally Posted by Mosu View Post
fresh of the presses here's MKVToolNix v57.0.0.
Thanks!
filler56789 is offline   Reply With Quote
Old 22nd May 2021, 14:49   #1068  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Location: Canada
Posts: 570
Thank you!
__________________
LG C2 OLED | GitHub Projects
quietvoid is offline   Reply With Quote
Old 22nd May 2021, 16:33   #1069  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 629
Thanks, Mosu.
von Suppé is offline   Reply With Quote
Old 23rd May 2021, 00:55   #1070  |  Link
Perenista
Registered User
 
Join Date: Oct 2013
Posts: 205
I am having a problem with both MKVToolnix and gMKVExtractGUI. This needs clarification because I am always confused about this.

Let's say I have two MKVs from a movie, a Blu-ray released in 2010 and another in 2020. Both are the same in terms of sync/length, just different discs.

Then I create a new audio track to be added to both. A dubbing.

Later I discover I need to introduce a positive delay of 1 second (or 1000 ms) while adding to MKVToolnix. So this works and track #2 is 100% synchronized with video #1.

This is WHAT I AM TRYING TO DO:

a) Remove track #2 from video #1 (from there only, assume I lost my original recording);
b) Add track #2 to video #2.

I always use gMKVExtractGUI for that extraction.

When I open this program I see that track has the 1000 ms information in there. This is also added to the file when we extract, so it's now being called track-2-1000ms.mp3.

My question:

If I simply add track #2 (after extracting from video #1) to video #2 it will be out of sync.

So that means I need to insert the 1000 ms information again?

That would be the logical next step.

Even if the answer is YES, what if I informed a positive (or negative) delay to subtitles? If I did that then I would have no way of knowing what to do next.

This is how gMKVExtractGUI is reading video #1:



Are there any chances of these positive and negative delays not working with some players/hardware? At least in my PC I never had issues.

Of course if we are talking about SRT subtitles, for example, it would be better to already add the positive delay with a dedicated program:



In this case Subtitle Workshop, which adds 1 second to the entire file.

That would spare MKVToolnix from doing the same.

But we can't insert a 1 second of silence into a MP3 or any other track without reencoding, which is why when needed I always insert these delays using MKVToolnix.

Last edited by Perenista; 23rd May 2021 at 00:59.
Perenista is offline   Reply With Quote
Old 23rd May 2021, 09:15   #1071  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 629
Using MKVToolnix for years, I never tried delays on subtitles so I couln't tell you about player issues for that matter.
I don't know whether MKVToolnix would define srt-delay by header or that it will adjust the timestamps within the srt itself.
I think that, for your own reassurance, it may be a good idea to make a sample mkv where you apply delay on srt (maybe two srt's: one with postive and one with negative value). After that, demux the mkv and compare the "original" srt to the demuxed one(s). Then you can make out how MKVToolnix handles srt delays, my guess.

BTW, a bit off-topic, but beware that negative delays on audio means that MKVToolnix will simply chop off the given time from the beginning of the soundtrack. Thus, that (small) part will be lost in the mux and can't be recovered.
von Suppé is offline   Reply With Quote
Old 23rd May 2021, 10:04   #1072  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
How to correctly convert this command line
Code:
"mkvextract.exe" tracks "C:\video.mkv" 1:"C:\Temp\RipBot264temp\job1\audio.opus"
to json file?

I tried that...
Code:
[
  "tracks",
  "C:\\video.mkv",
  "1:",
  "C:\\Temp\\RipBot264temp\\job1\\audio.opus"
]
...and i got this error

Last edited by Atak_Snajpera; 23rd May 2021 at 10:13.
Atak_Snajpera is offline   Reply With Quote
Old 23rd May 2021, 10:05   #1073  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by Perenista View Post
a) Remove track #2 from video #1 (from there only, assume I lost my original recording);
b) Add track #2 to video #2.

I always use gMKVExtractGUI for that extraction.
Why? You should rather simply remux from the original Matroska file. Add the first file. Deactivate muxing of track #2. Add the second file. Deactivate everything but track #2 from the second file. Multiplex.

Extraction is a lossy process as a lot of information (most importantly timestamps, but also track languages, titles etc.) cannot be stored in the elementary streams produced by mkvextract.

When you mux directly from Matroska you don't have to worry about losing existing delays.

Extraction should only be necessary if you need modifications to the content of a track, e.g. re-encode to a different codec or change the wording in subtitle tracks.

As for delays, there's a FAQ entry about how delays work in Matroska files.

Quote:
Originally Posted by Perenista View Post
Of course if we are talking about SRT subtitles, for example, it would be better to already add the positive delay with a dedicated program:
Both that external program as well as mkvmerge simply modify the timestamps by adding your delay. It's the same modification.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.

Last edited by Mosu; 23rd May 2021 at 10:18.
Mosu is offline   Reply With Quote
Old 23rd May 2021, 10:08   #1074  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by Atak_Snajpera View Post
How to correctly convert this command line
Code:
"mkvextract.exe" tracks "C:\video.mkv" 1:"C:\Temp\RipBot264temp\job1\audio.opus"
to json file?
Command line arguments are split on spaces not enclosed in quotation marks. Your command line has three arguments, not four. Therefore the correct JSON is:

Code:
[
  "tracks",
  "C:\\video.mkv",
  "1:C:\\Temp\\RipBot264temp\\job1\\audio.opus"
]
"The file could not be opened or parsed" usually means that the source file's name is wrong. Are you sure your source file is located directly in C:\ ? Another possibility is that the video.mkv is still open in another program that has a exclusive lock on it.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.

Last edited by Mosu; 23rd May 2021 at 10:16.
Mosu is offline   Reply With Quote
Old 23rd May 2021, 10:13   #1075  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Ok! Thanks mosu. Problem solved.
Atak_Snajpera is offline   Reply With Quote
Old 25th May 2021, 22:01   #1076  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Quote:
Originally Posted by von Suppé View Post
With the "no support for DV two separate files" in your last post there, I assume you mean when importing previously demuxed BL and EL streams?
After reading up about Dolby Vision some more[1][2], I'm more confident in my wording. As far as I understood things, Dolby Vision always comes with a Base Layer (BL) and, depending on the profile, might come with a second layer, the Enhancement Layer (EL). There are two different ways to store that Enhancement Layer:
  1. Intermixed with the Base Layer in a single track. The EL NALUs are transported as NALUs of type UNSPECIFIED_63. If the container has global codec initialization data (e.g. MP4 or Matroska), the track headers might store an HEVCDecoderConfigurationRecord for that Enhancement Layer in addition to the HEVCDecoderConfigurationRecord & the DolbyVisionConfigurationRecord for the Base Layer. For MP4 files, the HEVCDecoderConfigurationRecord for the Enhancement Layer is stored in a hvcE atom. Alternatively the data (VPS, SPS & PPS of the EL) can be stored in the bitstream wrapped into UNSPECIFIED_63 NALUs. For containers that do not have global codec initialization data (e.g. MPEG transport streams), the Enhancement Layer initialization data can only be transmitted in the bitstream wrapped as UNSPECIFIED_63 NALUs.
  2. As two separate tracks: the Base Layer and the Enhancement Layer are a track each, the container signals their connection somehow (MP4 & MPEG-TS do this differently). Containers with global codec initialization data (MP4) will only use one regular HEVCDecoderConfigurationRecord (hvcC atom in MP4) for each track and a DolbyVisionConfiguration (dvcC or dvvC for MP4) for… one of them (EL?), but there will be no hvcE atom necessary.

What mkvmerge 57.0.0 already supports is reading single-layer DV from MP4 & Matroska as well as dual-layer-with-both-layers-in-the-same-track from MP4 & Matroska.

What mkvmerge will support soon (see MR 2232) is reading single-layer DV from raw HEVC elementary streams (ITU-T H.265 Annex B) or from MPEG transport streams.

What mkvmerge will NOT support anytime soon is reading dual-layer DV with the BL & the EL being in different tracks, no matter where they might come from (MP4, MPEG-TS, HEVC elementary streams in different files) for two reasons:
  1. Matroska doesn't have facilities to flag that two tracks belong together in the way required for it.
  2. It is unclear if it would be possible to convert dual-layer-in-two-tracks to dual-layer-in-single-track by simply re-wrapping/converting the regular HEVC NALUs of the EL to the UNSPECIFIED_63 style NALUs intermixed with the BL. Finding information about that is… hard, and the specs are obviously not public.

Does that makes things clearer?

[1] "Dolby Vision Streams Within the ISO Base Media File Format"
[2] "Dolby Vision in MPEG-TS"
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 28th May 2021, 20:12   #1077  |  Link
Perenista
Registered User
 
Join Date: Oct 2013
Posts: 205
Quote:
Originally Posted by Mosu View Post
Why? You should rather simply remux from the original Matroska file. Add the first file. Deactivate muxing of track #2. Add the second file. Deactivate everything but track #2 from the second file. Multiplex.

Extraction is a lossy process as a lot of information (most importantly timestamps, but also track languages, titles etc.) cannot be stored in the elementary streams produced by mkvextract.

When you mux directly from Matroska you don't have to worry about losing existing delays.

Extraction should only be necessary if you need modifications to the content of a track, e.g. re-encode to a different codec or change the wording in subtitle tracks.

As for delays, there's a FAQ entry about how delays work in Matroska files.

Both that external program as well as mkvmerge simply modify the timestamps by adding your delay. It's the same modification.
About my message, this is what I discovered:

- If you add any audio/subtitle track and insert a delay (let's say 1 second or 1000 ms, positive), then that information is stored in your Matroska, but the track itself remains untouched.

So 1000 ms is just an internal information like the language your track reffers to, if it's a forced subtitle, etc. The track itself of course is not modified, because there's no reencode, so the 1000 ms was not permanently inserted into it. This was a confusion I made in the past, because I am always moving these from one source to another.

And since there's no reencode it's true that if it's reading that way:



Then that "descriptive" track once extracted I'll need to inform MKVToolnix again it has to add a 1820 ms delay, if I put into another video.

With subtitles, no matter what (SRT, VobSub or PGS) this information is not being displayed (see above), but again they are not being modified, so even if you added a 5000 ms positive delay into your MKV the subtitle track is untouched.

What I have been doing here in order to check if two videos are in sync is to skip to a specific scene, say, at 29m32s-500s, and freeze at that moment. If video #2 happens to be at this exact moment with a very small variation, say, 29m32s-450s, then we know they may be from different sources, however are the same (other moments need to be checked because it may be in sync for the first 30 minutes, then gradually change).

Example: Jurassic Park (1993) in UHD/4K and 1080p Blu-ray, no differences there, for the entire movie (note: some movies do have a difference, it may be a small one, say, 200 ms, others more, usually 1 or 2 seconds).

I didn't know it was possible to simply add one specific content/track from one MKV inside another.

I thought you always had to extract anything, otherwise it wouldn't work somehow.

Really, you just have to disable the other tracks that you don't want to add there.

Last edited by Perenista; 28th May 2021 at 20:19.
Perenista is offline   Reply With Quote
Old 28th May 2021, 20:39   #1078  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
You're not entirely wrong, but not entirely right either.

When you use a delay in Matroska what happens is that the timestamps are modified but not the frame content.

Whether or not that modification survives a roundtrip through extraction & re-muxing solely depends on the container used during extraction. For example, AC-3 tracks are written to raw AC-3 files, and those do not support timestamps. Therefore modification of Matroska's timestamps don't survive extraction. (Things are slightly different with negative delays as in that case frames are actively dropped during the initial muxing step, and of course those cannot be re-inventeded during the extraction. For example, if you have a delay of -400ms and each frame is 32ms long, then mkvmerge would drop 13 frames (-400ms + 13 * 32ms = 16ms). Of course you don't have to specify -400 again if you extract & remux as that would drop ANOTHER 13 frames. Instead you'd have to specify 16ms now.)

All subtitles formats, on the other hand, always contain timestamps, and therefore modification to Matroska's timestamps do survive an extraction of a subtitle track to a subtitle file.

Quote:
Really, you just have to disable the other tracks that you don't want to add there.
Exactly. Don't extract. Just… don't.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 30th May 2021, 08:24   #1079  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 629
Quote:
Originally Posted by Mosu View Post
Does that makes things clearer?
Your explanation absolutely does.
Thanks for taking the time to do the reading on Dolby Vision.
von Suppé is offline   Reply With Quote
Old 30th May 2021, 09:20   #1080  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Quote:
Originally Posted by Mosu View Post
What mkvmerge will NOT support anytime soon is reading dual-layer DV with the BL & the EL being in different tracks, no matter where they might come from...
Out of interest what needs to come first... A new dual-layer Dolby Vision compliant .mkv file parser or the muxer?
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Reply

Tags
matroska

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:52.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.