After using mkvpropedit via CLI, MKV file cannot be opened with Windows Photos app

Hi all!

I’m using MKVPROPEDIT with a bat file in Windows to set the default audio tracks and turn the other to not default. The MKV file plays back just fine in Windows with Photos app. However, after I run the batch file to change the default, I can no longer play back the MKV file with the Photos app and get this error:

It looks like we don’t support this file format.

Here is the batch file that I use:

@echo off
setlocal

REM Set this if mkvpropedit is not in PATH
set MKVTOOLNIX_PATH=“C:\winapps\MKVtoolnix\mkvpropedit.exe”

for %%F in (*.mkv) do (
echo Processing “%%F”…

REM Set track 1 as not default
%MKVTOOLNIX_PATH% "%%F" --edit track:a1 --set flag-default=0 --set language=fr

REM Set track 2 as default
%MKVTOOLNIX_PATH% "%%F" --edit track:a2 --set flag-default=1 --set language=ro

REM Set track 3 as not default
%MKVTOOLNIX_PATH% "%%F" --edit track:a3 --set flag-default=0 --set language=en

)

echo Done.
pause

What is MKVPROPEDIT doing that is causing this?

When I use MKVTOOLNIX GUI to set these defaults manually, the output MKV works fine, it uses the same MKVPROPEDIT exe. Is there some command line switch I’m missing?

Would really appreciate some help.

TY

Please see this FAQ entry which explains what’s happening.

Thank you for this, it looks like it applies to my situation, I guess mkvtoolnix uses mkvmerge to remux the output mkv file so this is why it works when I use it?

If you find yourself in this situation, you’ll have to re-mux the affected files with mkvmerge / the GUI’s multiplexer tool. You don’t have to change anything, to set any special option — a simple re-mux suffices (e.g. mkvmerge -o out.mkv in.mkv).

I will give it a go to add a send part to my BAT file to batch remux the files using MKVMERGE and see how it goes.

Cheers

The MKVToolNix package consists of one GUI (MKVToolNix GUI) & several command-line utilities (among them mkvpropedit & mkvmerge). For the multiplexing stuff the GUI uses mkvmerge; for header editing it does things itself (instead of calling mkvpropedit). So yes, MKVToolNix GUI uses mkvmerge, therefore just re-muxing with the CLI tool mkvmerge or the GUI”s multiplexer tool is identical in effect.

Ok thanks - looks like remuxing it worked, however I saw that some “tags” were removed with the remuxing, when I checked with MKVTOOLNIX - not sure what they were but any audio / subs are still there and now I can playback the file with Photos app - ty!!