Help - Is there any way to check mkv contaiuner info against its actual content

Discussion in 'Third Party Products' started by Steve55, Jul 24, 2020.

  1. Steve55

    Steve55 Well-Known Member

    This would probably be better in some other video forum but I'm only in this one, so I'll ask here. If the answer is known, Im pretty sure someone here will know.

    For historical reasons, i have definitely ended up with mkv files where the header is wrong for the content. E.g. often wrong number of channels, but it seems other things like color space also.

    Is there any software, or script, around that could automate the process of checking such things? I have tens of thousands of mkv files.
  2. James

    James Redfox Development Team Staff Member

    Maybe mkvpropedit from MKVToolNix?
    You might be able to create a batch / script file, which calls it in a loop for all your files...
  3. Steve55

    Steve55 Well-Known Member

    Hi James, Thanks, yes I can definitely script mkvpropedit but it's not the problem to reset the headers, its identifying the files which have a problem (and all the possible problems, which especially in this audio stuff is a minefield which I don't well understand) which is the issue. What I need to do conceptually is

    For all files
    Read File
    retieve audio and video properties of content ignoring what the mkv says
    Check against existing mkv headers (and extensions)
    Write corrected info when necessary
    Move to next file
  4. DrXenos

    DrXenos Well-Known Member

    What I do is call mkvmerge with -i -F json options to dump the contents of the mkv into a json file. It's then quite trivial to parse that.
  5. Steve55

    Steve55 Well-Known Member

    Hi Dr Xenos
    Thanks a lot for that, wasnt aware of that functionality in mkvmerge.
    The other possibility I now discovered is ffprobe.
    I need to do a bit more research and checking to see what these things are ‘really’ telling me, but I’m sure now it will be easily scriptable to do what I need.
    Thanks again
    Last edited: Jul 29, 2020
  6. DrXenos

    DrXenos Well-Known Member

    Another option would be HandBrake Cli using --json --title 0