VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. 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?
    Quote Quote  
  2. 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.
    Quote Quote  
  3. 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
    Quote Quote  
  4. 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.
    Quote Quote  
  5. Member netmask56's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Search Comp PM
    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
    Quote Quote  
  6. Originally Posted by sneaker View Post
    it sounds more like a hardware problem
    Exactly what I was thinking.

    Inconsistent results from repeated attempts suggest hardware issue like dying HDD, faulty memory, maybe unstable overclock, flaky PSU, those sorts of things. Run some system diagnostics and hardware tests
    Quote Quote  
  7. Originally Posted by netmask56 View Post
    Have you used gMKVExtract to extract the audio. video, subs etc. I've always found it to work well.
    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?
    Quote Quote  
  8. Originally Posted by poisondeathray View Post
    Originally Posted by sneaker View Post
    it sounds more like a hardware problem
    Exactly what I was thinking.

    Inconsistent results from repeated attempts suggest hardware issue like dying HDD, faulty memory, maybe unstable overclock, flaky PSU, those sorts of things. Run some system diagnostics and hardware tests
    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?
    Quote Quote  
  9. Originally Posted by bennyutzer View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by sneaker View Post
    it sounds more like a hardware problem
    Exactly what I was thinking.

    Inconsistent results from repeated attempts suggest hardware issue like dying HDD, faulty memory, maybe unstable overclock, flaky PSU, those sorts of things. Run some system diagnostics and hardware tests
    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.
    Those "random" errors are very suspicious . If program was at fault you would expect the same behaviour every time, not different behaviour each time
    Quote Quote  
  10. 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
    Quote Quote  
  11. Originally Posted by bennyutzer View Post
    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?
    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.)
    Quote Quote  
  12. 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.
    Quote Quote  
  13. i finished watching the vides, and they are all fine. embarking on the search for the error in my hardware now
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!