hi everyone,
i am currently playing around with an automated solution to convert videos to h265/aac, and part of that is extracting tracks from an mkv and putting them into another mkv.
for extracting, i use the "mkvextract tracks ..." command, for integrating them into another mkv i use "mkvmerge".
when checking the results, i find that some of the videos contain errors, where the movie jumps from one point to a couple seconds later in the video, with the video inbetween lost and some artifacts and picture errors.
believing that the aac could be part of the problem, i added the "--aac-is-sbr 0" flag to the mkvmerge command, but am still getting errors sometimes.
having performed the same operation with MKVToolnixGui (to compare results) i found that it uses the "mkvmerge" command to extract tracks from an mkv, instead of the "mkvextract" command, which i have been using.
my question: is there any difference in using these two commands to extract tracks from an mkv? do they work differently in any way? is there a chance that the mkvextract command is to blame for the errors i have been getting?
+ Reply to Thread
Results 1 to 13 of 13
-
-
to clarify: i start off with an mkv that has h265 video and some audio tracks (ac-3, dts or other). these audio tracks are then extracted with "mkvextract tracks", encoded in aac using an audio converter, then muxed into a new mkv with the untouched video and the converted audio tracks.
the video, before extracting and reintegrating, is flawless, as well as the unencoded audio. it is only after putting the parts into the mkv, that the errors show up.
conspicuously, the errors seems to occur randomly, meaning when i repeat the whole process for the same video, the error might still show up, but in a different place than before. -
mkvmerge outputs mkv files from various input formats (incl. mkv)
mkvextract outputs various formats (not mkv!) from mkv input
If your goal is to create an mkv file you don't need mkvextract. Waste of time.
That aside there should be no errors when using mkvextract to output "raw" HEVC and then mux it to mkv. I would have said it's an mkvtoolnix bug but if it happens in different places if you repeat the process (which, btw, mkvextract or mkvmerge?) it sounds more like a hardware problem -
this is a real pain in the ass:
i have now refurnished my process to use mkvmerge to extract the tracks.
i have gotten to find that the errors are due to "mkv structure errors", that occur only after the extracting of the tracks. my errors are the exact type of error that is described here: https://github.com/mbunkus/mkvtoolnix/issues/651.
the github feed is about MKVToolnix, i use mkverge without gui. the error message is "error in the matroska file structure at position ...".
what blows my mind is that it happens sometimes and sometimes not. if it happens, i just redo the remuxing and the error is gone. i even found, that the corrupted parts of the video sometimes include parts of ANOTHER video, that wasnt even part of the process. how can this be? is there a solution to this problem?
again in short: the source video is flawless, i extract all the tracks (video, audio, subs), encode the audio, remux all back together and the video, which is not touched anywhere in the process, is screwed up.
i am dying to solve this. if anybody knows how, please help. -
Have you used gMKVExtract to extract the audio. video, subs etc. I've always found it to work well.
SONY 75" Full array 200Hz LED TV, Yamaha A1070 amp, Zidoo UHD3000, BeyonWiz PVR V2 (Enigma2 clone), Chromecast, Windows 11 Professional, QNAP NAS TS851 -
-
if i see this correctly, gMKGExtract is a gui that utilizes mkvextract, which is exactly what i have been using. my goal is to automate this whole process, so guis are not what i am looking for. but thanx for the tip.
it seems to me, that the error with including parts from other videos in the corrupted mkv comes from processing many videos in a row, which i have done originally. when i process the videos one by one, they seem clear so far.
is there a way to "reset" mkvmerge, so that there are no remnants from past processings? some way to clean the pipe, delete the cache or whatever? -
thanx for the tip, i am goint to perform the process on a different pc to rule out hardware trouble. but i do wonder: i encoded the videos from bluray to h265 on the same pc, without having any trouble. if the hardware was the problem, wouldnt there have been signs all over the place before? can it be that some hardware trouble only manifests when using this particular program?
-
Encoded. Past tense. What if something happened now or between the time you encoded and today?
If my car ran well 16 years ago does it mean it will run ok today ? Maybe something happened in 15 years in between ?
conspicuously, the errors seems to occur randomly, meaning when i repeat the whole process for the same video, the error might still show up, but in a different place than before. -
Another difference between mkvtoolnix vs. mkvextract/mkvmerge I was going to mention is VFR - if source was VFR, mkvtoolnix will copy timecodes if you just add some audio or replace audio. By you need to extract timecodes and remux timecodes if you use mkvextract. That could explain errors or playback issues in output file ,but that wouldn't explain the "randomness" in what you describe. Randomness or inconsistent results suggest hardware issue
-
I have seen such things only when a program reserves HDD space that has been previously used by other files without actually overwriting all of it. I never had it with mkvtoolnix and I don't know how it writes. There a different ways (APIs/system calls) to write files on Windows and user rights (admin/user/UAC) also play a role.
Either way I wouldn't know how to debug/fix this. Mkvtoolnix author has never found a way to reproduce it and until he does the issue will remain unfixed even if it may be his fault. (Even though randomness suggests hardware issues the truth is we simply don't know the cause. I wouldn't fully exclude an mkvtoolnix bug.) -
i have reprocessed a batch of videos on a different pc and am now in the process of watching them back to back to check for errors. it will take a while, but at first glance after 3 videos it seems to be ok. chances are it is in fact a hardware problem. i will report back, when i finished the whole list, which will probably take a couple of days.
thanx to everyone who contributed knowledge and wisdom. -
i finished watching the vides, and they are all fine. embarking on the search for the error in my hardware now
Similar Threads
-
How to embed subtitles into mkv STEP BY STEP using MKVMERGE and MKVEXTRACT
By lelouch283 in forum SubtitleReplies: 30Last Post: 23rd Jun 2017, 14:04 -
32GB limit in MKVExtract & MKVCleaver?
By theirongiant in forum Video ConversionReplies: 4Last Post: 15th Dec 2016, 20:36 -
MKVExtract / MKVtoolnix
By TheRandomOne in forum Video ConversionReplies: 1Last Post: 5th Jan 2016, 09:35 -
Don't know how to get mkvextract
By TheLPFan1997 in forum Newbie / General discussionsReplies: 2Last Post: 27th Mar 2014, 02:56 -
MKVExtract not working as expected.
By ZVar in forum SubtitleReplies: 1Last Post: 16th Nov 2013, 21:18