WDTV Forum - WDTV Media Player

WDTV LIVE Groups => WDTV LIVE - General Discussion => Topic started by: adrian on August 09, 2010, 04:25:59 AM

Title: mkv header compression easy fixes using batch files
Post by: adrian on August 09, 2010, 04:25:59 AM
did this for myself since i am a really lazy person and decided to share it with others. i wanted an easy way to quickly fix multiple mkv files so they would work on my wdtv. these two solutions work on every mkv in a folder and subfolders. most of the work is not mine, i had problems getting the original batch files i found to work so i just fixed, modified, cut and pasted into new ones which worked for me.

firstly from the matroska website http://www.matroska.org/downloads/mkclean.html (http://www.matroska.org/downloads/mkclean.html) is a tool called mkclean. in this download zip is another tool mkWDclean.exe
make a folder and put mkWDclean.exe in it then create a batch file and paste and copy the code below into it.
Code: [Select]
FOR /F "delims=*" %%A IN ('dir /b /s *.mkv') DO CALL:WDTVFIX "%%A"
START "" logging.txt
GOTO :eof
:WDTVFIX
mkWDclean --optimize %~dpnx1 %~dpn1_fixed.mkv
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> logging.txt
goto :eof)
ECHO OFF
REM remove the REM's below to delete original files
REM if exist "%~dpn1_fixed.mkv" (
REM del "%~dpnx1")
ECHO Processing of %~nx1 successful! >> logging.txt
goto :eof

save the batch file and double click to run it. (if you should want to stop it part way through the keyboard shortcut is Ctl-C)

what it does is for every file *.mkv it finds it runs it through mkWDclean and saves the output as *_fixed.mkv
it does not delete the original files unless you remove the REM from the bottom so it reads
Code: [Select]
FOR /F "delims=*" %%A IN ('dir /b /s *.mkv') DO CALL:WDTVFIX "%%A"
START "" logging.txt
GOTO :eof
:WDTVFIX
mkWDclean --optimize %~dpnx1 %~dpn1_fixed.mkv
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> logging.txt
goto :eof)
ECHO OFF
REM remove the REM's below to delete original files
if exist "%~dpn1_fixed.mkv" (
del "%~dpnx1"
ECHO Processing of %~nx1 successful! >> logging.txt
goto :eof

an alternate method already used by others on this site uses mkvmerge. i just created a batch file to automate it.
you need the latest mkvtoolnix from their website http://www.bunkus.org/videotools/mkvtoolnix/downloads.html (http://www.bunkus.org/videotools/mkvtoolnix/downloads.html)
there are two batch files depending upon whether you use the installer or the standalone 7zip archive

installed version
create a folder and make a batch file containing the code below. put your mkv files in the folder and run the batch file to fix them.

Code: [Select]
REM Whipped up by TEKNO to fix MKV header compression issues on Standalone media players!
REM fixMKV version 1.2
REM Requires MKVToolnix v4.1.1 INSTALLED (it auto detects where)
@ECHO OFF
cd "%~dp0"
SET KEY="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\mmg.exe"
FOR /F "tokens=2*" %%A IN ('REG QUERY %KEY%') DO SET MKVTOOLPATH=%%B
ECHO MKVToolnix found at %MKVTOOLPATH% > logging.txt
FOR /F "delims=*" %%A IN ('dir /b /s *.MKV') do CALL :MKVFIXMUX "%%A" "%MKVTOOLPATH%"
START "" logging.txt
GOTO :eof
:MKVFIXMUX
"mkvmerge.exe" -o "%~dpn1_fix.mkv" --engage keep_bitstream_ar_info -A -S --compression -1:none "%~dpnx1" -D -S --compression -1:none "%~dpnx1" -A -D --compression -1:none "%~dpnx1"
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> logging.txt
goto :eof)
REM if exist "%~dpn1_fix.mkv" (
REM del "%~dpnx1")
ECHO Processing of %~nx1 successful! >> logging.txt
goto :eof

in the original version the link to the mkvmerge program was referenced by "%~dp2mkvmerge.exe" which did not work on my system(s) but did when i changed it to "mkvmerge.exe" (when you install mkvtoolnix it creates a PATH reference to its install folder.

standalone version
create a folder and extract mkvtoolnix-unicode-4.2.0.7z into it so it is in a sub-folder called mkvtoolnix. the archive uses 7zip http://www.7-zip.org/download.html (http://www.7-zip.org/download.html).
create a batch file in the folder and paste the code below into it. launch the batch file to fix all mkv files in the directory.

Code: [Select]
REM Whipped up by TEKNO to fix MKV header compression issues on Standalone media players!
REM MKVfix version 1.2
REM For use with the ZIPPED version of MKVToolnix v4.1.1 or greater
REM Change the "SET MKVTOOLPATH =" to the DIRECTORY that you have unzipped MKVToolnix too!
@ECHO OFF
cd "%~dp0"
SET MKVTOOLPATH=%~dp0mkvtoolnix
ECHO MKVToolnix found at %MKVTOOLPATH% > logging.txt
FOR /F "delims=*" %%A IN ('dir /b /s *.MKV') do CALL :MKVFIXMUX "%%A" "%MKVTOOLPATH%"
START "" logging.txt
GOTO :eof
:MKVFIXMUX
%MKVTOOLPATH%\mkvmerge.exe -o "%~dpn1_fix.mkv" --engage keep_bitstream_ar_info -A -S --compression -1:none "%~dpnx1" -D -S --compression -1:none "%~dpnx1" -A -D --compression -1:none "%~dpnx1"
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> logging.txt
goto :eof)
REM if exist "%~dpn1_fix.mkv" (
REM del "%~dpnx1")
ECHO Processing of %~nx1 successful! >> logging.txt
goto :eof

again to get it to delete the originals delete the "REM " from the two lines so they are
Code: [Select]
if exist "%~dpn1_fix.mkv" (
del "%~dpnx1")
i had two problems with the original version of this firstly the SET MKVTOOLPATH= was SET MKVTOOLPATH = , it didn't like the spaces. and secondly it again failed to reference mkvmerge successfully.
hopefully this will be of use to someone until wd gets round to adding support for header compression to their firware; but i will not be holding my breath.

in terms of speed the mkvmerge method is faster.
Title: Re: mkv header compression easy fixes using batch files
Post by: Whoheart on August 09, 2010, 07:24:48 PM

That's great Adrian, thanks for going through all the trouble! :)
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on August 10, 2010, 02:27:42 AM
Nice Tut

Tx Bro
Title: Re: mkv header compression easy fixes using batch files
Post by: s1l3nc0r on August 23, 2010, 07:53:34 AM
Thanks a lot for this quick fix.

Do you think it would be possible to automate this process ?

So every time a new mkv file appears in a directory, it gets passed through this batch script.

Title: Re: mkv header compression easy fixes using batch files
Post by: adrian on August 23, 2010, 02:43:42 PM
i am sure it is possible to use a wildcard match to omit those which have already been processed, but one of the issues i had early on was it went through the folder alphabetically and fixed those files which had already been fixed. e.g. it fixed "video1.mkv" to "video1-fixed.mkv" and then fixed "video1-fixed.mkv" to "video1-fixed-fixed.mkv"

at this point since it only has to deal with a small subset of mkv with header compression enabled i prefer a level of human intelligence rather than the blind obedience of computers.
i'd rather know that every mkv i put in a folder will be fixed when i run the batch and get a coffee, and can then be moved into the various subfolders i want, rather than hope a rogue named mkv does not end up in the folder and gets fixed repeatedly filling up hdd space.

there is no reason the batch file cannot be scheduled to run at set intervals but again you run into the literal mindedness of computers which will faithfully gigo (garbage in garbage out) you into a mess.

alternatively there are undoubtedly people out there with much better batch skills than me who could figure out a way to omit those mkv which have already been processed; i am not one of them. i figured out just enough to get it to work until wd update their firmware. already i am seeing some of those groups which had header compressione enabled now disabling it so i am satisfied with what i have.  :-\
Title: Re: mkv header compression easy fixes using batch files
Post by: allstar1 on August 25, 2010, 03:00:06 PM
Thanks a lot for this,very helpful.
 
Edit : I tried the batch file with mkWdclean and its not working, a cmd window shows up and runs quickly and then nothing happens.
Title: Re: mkv header compression easy fixes using batch files
Post by: adrian on August 26, 2010, 03:13:57 AM
most obvious cause of that would be that the batch file did not find mkwdclean.exe in the same folder as the batch file. if it still does not work i suggest the mkvmerge standalone version batch file, it's the one i found fastest.
Title: Re: mkv header compression easy fixes using batch files
Post by: allstar1 on August 26, 2010, 04:57:45 PM
well the mkwdclean.exe was in the same directory so idk what went wrong.Anyways,took your advice and switched to the standalone mkvmerge option and it works (it's also faster like you said),but now the problem is it wont delete the old file even though i removed the two "rems" from the end of the .bat file.Still,it's only a minor problem, thanks and good work Adrian ;D.
Title: Re: mkv header compression easy fixes using batch files
Post by: millsjw on August 28, 2010, 05:28:00 AM
HERE is a way to fix the batch.

Add this line at the top:

md fixedMKV         (note: this will fail if dir is there, but no harm)


Now, add the path to the begining of the output file line 

mkWDclean --optimize %~dpnx1 fixedMKV\%~dpn1_fixed.mkv

That will put the output file in a sub directory and the batch will not see it.

Well, my mkWDclean stops at 85% on the 2nd pass for any file, plain or with the --optimize  option.

Title: Re: mkv header compression easy fixes using batch files
Post by: adrian on August 30, 2010, 12:14:59 AM
i fixed the issue of the batch fixing files which had already been fixed during a single run of the batch file using the line
FOR /F "delims=*" %%A IN ('dir /b /s *.mkv') DO CALL:WDTVFIX "%%A"
except that the /s switch causes it to look in subdirectories too. although that switch can be easily removed
the problem is that there is no way for the batch file to tell which files have already been processed in a previous run without using either some sort of wildcard matching (which i would not trust to always work) or possibly check if the fixed version already exists, in which case you would need to keep the original as well as the fixed, twice as much hdd space.

i suppose combining the removal of the /s switch with saving to a subdirectory and deleting the original should work; but not if you sort files into directories and want to do an inplace fix and replace. at some point human intervention is required.

maybe a batch file guru can figure out a way to do all this automatically.
Title: Re: mkv header compression easy fixes using batch files
Post by: s1l3nc0r on August 31, 2010, 01:22:07 AM
I was looking for a way to enhance the script a bit further.

I modified it the following way:
It looks in current directory and subdirectories for all mkv files.
It then creates a folder called FixedMKV in the root of the drive the file is located in.
It then removes header compression creating a file including the full directory path and filename in the FixedMKV-folder.
After successfull creation it removes the original mkv file.
The logging.txt file will be created in the FixedMKV-folder.

I created the scipt this way to retain the directory structure I set up for my tv series (TV\Series Name\Season Number\Series Name - S..E...mkv.

HINT: If you have the mkvtoolnix installed, you can put Fixmkv.cmd on the desktop and you can drag and drop files on it, from wherever you like, works exactly the same.

Quote
REM Whipped up by TEKNO to fix MKV header compression issues on Standalone media players!
REM Enhanced by s1l3nc0r to assure files will only be ran once, containing directory structure
REM fixMKV version 1.3
REM Requires MKVToolnix v4.1.1 (or later) INSTALLED (it auto detects where)
@ECHO OFF
%~d1
CD\
MD FixedMKV
CD "%~p1"
SET KEY="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\mmg.exe"
FOR /F "tokens=2*" %%A IN ('REG QUERY %KEY%') DO SET MKVTOOLPATH=%%B
ECHO MKVToolnix found at %MKVTOOLPATH% > "%~d1\FixedMKV\logging.txt"
FOR /F "delims=*" %%A IN ('dir /b /s *.MKV') do CALL :MKVFIXMUX "%%A" "%MKVTOOLPATH%"
START "" "%~d1\FixedMKV\logging.txt"
GOTO :eof
:MKVFIXMUX
"%~dp2mkvmerge.exe" -o "%~d1\FixedMKV\%~pn1.MKV" --engage keep_bitstream_ar_info -A -S --compression -1:none "%~dpnx1" -D -S --compression -1:none "%~dpnx1" -A -D --compression -1:none "%~dpnx1"
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> "%~d1\FixedMKV\logging.txt"
goto :eof)
if exist "%~d1\FixedMKV\%~pn1.MKV" (
del "%~dpnx1"
)
ECHO Processing of %~nx1 successful! >> "%~d1\FixedMKV\logging.txt"
goto :eof

Still looking for some way to automate this, like as soon as a file appears in the directory that is monitored, it will automatically be ran through this script.

Enjoy ...
Title: Re: mkv header compression easy fixes using batch files
Post by: adrian on August 31, 2010, 04:24:16 PM
i think that this is about as good as it is going to get without running the risk of a video getting repeatedly fixed.
i will set it up so the folder with Fixmkv.cmd is a [drop] folder which just has the folder structures in it and create a new root folder say [video720p] and change the batch to reflect that. then i just have to navigate to the [video720p] folder for all my tv shows.

i will probably also set it up to run from a standalone version of mkvmerge as i have the popcorn audioconverter software installed (for a friend with a gen1 wdtv). i just checked and during testing i upgraded to mkvtoolnix 4.20 and just now when i used audioconverter to downsample dts to ac3 it also performed header compression on all streams. to the point that when i tried to play the video on my wdtv live it freezes and then will not play any other videos until i unplug the power lead.

great  ::) if you have a gen1 wdtv you need both versions of mkvtoolnix, the before and after header compression was enabled builds.
uninstalled ver 4.2.0 and reinstalled 3.2.0.

here is a link to a bit of freeware that might do what you are after in automating conversions
http://leelusoft.blogspot.com/2010/07/watch-4-folder-22.html
it monitors a folder and subfolder and upon detecting an event can run a batch file

modified the code from s1l3nc0r in a few ways (thanks s1l3nc0r for your work)
most importantly it still looks in current directory and subdirectories for all mkv files.
changed a few of the variable names (i always had problems with %~d1 so changed it to %~d0)
set it up so it runs from the standalone 7zip version of mkvtoolnix so you can have a pre header compression version installed but still fix those which are bad.
used a lot more SET commands to set up variables that could be called in multiple places (e.g. location of logging.txt) so they are defined once but called from that definition whenever needed (avoids mistakes when editing.)
and now the biggies
with s1l3nc0r's version it used the whole path of the original file location to create the save path of the fixed files
e.g. D:\video\drop\TV\Series Name\Season Number\EpisodeName.mkv
would be saved into D:\FixedMKV\video\drop\TV\Series Name\Season Number\EpisodeName_fix.mkv
after some head sweat figured out a way around this so it would be saved in the equivalent of
D:\FixedMKV\TV\Series Name\Season Number\EpisodeName_fix.mkv
finally modified the logging so it records the date and time each time it is run. previous records are not erased and only opens the file if there is an error. this is primarily so it can be automated with "watch 4 folder"

to understand the code it helps to have some idea of the directory structures i envisioned.
the drive letter is never explicitly referenced so does not need to be changed anywhere.
in the root of a drive is a folder called [video], this is shared so it can be accessed as a network share by the wdtv live.
in this folder are two more folders [drop] and [video720p]
in the [drop] folder is the extracted 7zip archive of mkvtoolnix in its [mkvtoolnix] folder
also in the [drop] folder is the watch 4 folder program w4f22.exe and a batch file containing the code below. it needs to be saved with the extention *.bat as that is what w4f22 requires.
this version does delete the original if there is no error from the running of mkvmerge

Code: [Select]
REM Whipped up by TEKNO to fix MKV header compression issues on Standalone media players!
REM Enhanced by s1l3nc0r to assure files will only be ran once, containing directory structure
REM Enhanced by adrian to work as standalone with 7zip mkvtoolnix and a more aesthetic directory structure
REM can be automated using freeware Leelu Soft Watch 4 Folder 2.2
REM For use with the ZIPPED version of MKVToolnix v4.1.1 or greater
REM Change the "SET MKVTOOLPATH =" to the DIRECTORY that you have unzipped MKVToolnix too!
REM MKVfix version 1.3
@ECHO OFF
%~d0
cd\
md \video\video720p
cd "%~p0"
SET MKVTOOLPATH=%~d0\video\drop\mkvtoolnix
SET LOGGINGPATH=%~d0\video\video720p
ECHO. >> "%LOGGINGPATH%\logging.txt"
ECHO This run started %DATE% %TIME% >> "%LOGGINGPATH%\logging.txt"
ECHO MKVToolnix found at %MKVTOOLPATH% >> "%LOGGINGPATH%\logging.txt"
ECHO output base path is %LOGGINGPATH%
@ECHO OFF
FOR /F "delims=*" %%A IN ('dir /b /s *.MKV') do CALL :MKVFIXMUX "%%A" "%MKVTOOLPATH%"
GOTO :eof
:MKVFIXMUX
SET OUTPUTPATH1=%~dp1
SET OUTPUTPATH2=%OUTPUTPATH1:drop=video720p%
%MKVTOOLPATH%\mkvmerge.exe -o "%OUTPUTPATH2%\%~n1_fix.mkv" --engage keep_bitstream_ar_info -A -S --compression -1:none "%~dpnx1" -D -S --compression -1:none "%~dpnx1" -A -D --compression -1:none "%~dpnx1"
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> "%LOGGINGPATH%\logging.txt"
START "" "%LOGGINGPATH%\logging.txt"
goto :eof)
if exist "%OUTPUTPATH2%\%~n1_fix.mkv" (
del "%~dpnx1")
ECHO Processing of %~nx1 successful! >> "%LOGGINGPATH%\logging.txt"
goto :eof

variables you may want to modify to suit your setup
md \video\video720p
this is for the location of the logging.txt file as otherwise if will fail to be created the first time it is run.
SET MKVTOOLPATH=%~d0\video\drop\mkvtoolnix
the location of the mkvtoolnix folder containing mkvmerge.exe. %~d0 is a batch parameter call which returns the drive letter
SET LOGGINGPATH=%~d0\video\video720p
the location the logging file is stored. this must match the location of the folder created earlier using the md command.
SET OUTPUTPATH1=%~dp1
SET OUTPUTPATH2=%OUTPUTPATH1:drop=video720p%
the clever bit, %dp1 is the reference string for the drive and path to the current mkv file being processed
the variable OUTPUTPATH2 is the drive and path but in this string it replaces the substring {drop} with the substring {video720p} so
D:\video\drop\TV\Series Name\Season Number
becomes
D:\video\video720p\TV\Series Name\Season Number\

so you have the folders created and shared with this batch file in it and the w4f22.exe program too.
launch the w4f22.exe
select the [drop] folder, tick the box to Watch Sub Folders
tick the box in {Select The Events to Monitor} window for the first item {File Create}
select the {Actions on Events} to execute a program or a batch file. navigate to this batch file.
click on the save button to save a configuration file as it does not save settings between uses (save into {drop} folder for convenience)
click on the {Start Monitoring} button and then the Tray button to minimize it to the system tray.

now to test it.
create a folder, or set of subfolders.
copy a video into this subfolder and within moments of the video being finished writing to drive the batch file will run fixing it into the other file heirarchy and deleting the original.

there is only one caveat, and i don't see any way to avoid it yet
you can only really copy one video at a time. otherwise the batch file will be started for the first video whilst the second video is transferring and you'll get overlapping disk access and potentially the batch trying to fix a second video which hasn't completed transferring yet.
the workaround is easy, just stop w4f22.exe from monitoring whilst you are transferring multiple files, then manually start the batch file.

addendum. when first trying to configure w4f22.exe it would freeze on the folder i wanted to select, just that folder and no others. through trial and error i found out it was a massive zip file (122mb), i think the issue was that it is a special backup that contains 38,000 files in 26,000 folders. once i moved it to another place i was fine.
Title: Re: mkv header compression easy fixes using batch files
Post by: s1l3nc0r on September 01, 2010, 08:13:50 AM
Would it be possible for you to modify the script a bit so it will acept spaces in the directory and file names ?
Title: Re: mkv header compression easy fixes using batch files
Post by: adrian on September 01, 2010, 02:24:20 PM
thought the script didn't care about spaces in directory and filenames and i was nearly right. turns out the md command right at the beginning does care, which would generate errors for the logging.txt file creation. simply putting the md command inside quotation marks fixes that i.e.
md "\video\video 720p"

Code: [Select]
REM Whipped up by TEKNO to fix MKV header compression issues on Standalone media players!
REM Enhanced by s1l3nc0r to assure files will only be ran once, containing directory structure
REM Enhanced by adrian to work as standalone with 7zip mkvtoolnix and a more aesthetic directory structure
REM MKVfix version 1.4
REM For use with the ZIPPED version of MKVToolnix v4.1.1 or greater
REM Change the "SET MKVTOOLPATH =" to the DIRECTORY that you have unzipped MKVToolnix too!
@ECHO OFF
%~d0
cd\
md "\video\video 720p"
cd "%~p0"
SET MKVTOOLPATH=%~d0\video\drop\mkvtoolnix
SET LOGGINGPATH=%~d0\video\video 720p
ECHO. >> "%LOGGINGPATH%\logging.txt"
ECHO This run started %DATE% %TIME% >> "%LOGGINGPATH%\logging.txt"
ECHO MKVToolnix found at %MKVTOOLPATH% >> "%LOGGINGPATH%\logging.txt"
ECHO output base path is %LOGGINGPATH%
@ECHO OFF
FOR /F "delims=*" %%A IN ('dir /b /s *.MKV') do CALL :MKVFIXMUX "%%A" "%MKVTOOLPATH%"
GOTO :eof
:MKVFIXMUX
SET OUTPUTPATH1=%~dp1
SET OUTPUTPATH2=%OUTPUTPATH1:drop=video 720p%
%MKVTOOLPATH%\mkvmerge.exe -o "%OUTPUTPATH2%\%~n1_fix.mkv" --engage keep_bitstream_ar_info -A -S --compression -1:none "%~dpnx1" -D -S --compression -1:none "%~dpnx1" -A -D --compression -1:none "%~dpnx1"
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> "%LOGGINGPATH%\logging.txt"
START "" "%LOGGINGPATH%\logging.txt"
goto :eof)
if exist "%OUTPUTPATH2%\%~n1_fix.mkv" (
del "%~dpnx1")
ECHO Processing of %~nx1 successful! >> "%LOGGINGPATH%\logging.txt"
goto :eof

if you look at the code you'll see that other than the change i made to the md command the rest is just cosmetic, changed the folder [video720p] to [video 720p] for illustrative purposes
tested it on three videos all in directory paths with spaces in them and two of the videos had spaces in the file names. after copying the first two i set watch 4 folder monitoring with this batch file and then copied the third file across. it detected the file create, ran the batch file, and all three videos were fixed into the [video\video 720p\] heirarchy and the original deleted. all in the time it took me to get another coffee.

one note when modifying a line like
SET LOGGINGPATH=%~d0\video\video 720p
don't put the variable within quotation marks so it reads
SET LOGGINGPATH="%~d0\video\video 720p"
otherwise when the variable LOGGINPATH is called the substituted string will include the quotation marks e.g.
"D:\video\video 720p"\logging.txt
which will obviously not work.
Title: Re: mkv header compression easy fixes using batch files
Post by: ChumpusRex on September 26, 2010, 04:21:28 AM
Just an update here - But I've put together a small GUI for automating the remuxing process.

Just click on a directory - it scans it, identifies which files have header compression, and then remuxes them in the background (without having multiple console windows popping up).

It worked fine for me. Hopefully, some people will find it simpler than a batch file. As it really is a 2-click process.

It requires:
.NET framework v3.5 or v 4 (should be automatically installed by Windows update on XP and higher)
MKVToolNix v4.3.0 or newer http://www.bunkus.org/videotools/mkvtoolnix/win32/mkvtoolnix-unicode-4.3.0-setup.exe (http://www.bunkus.org/videotools/mkvtoolnix/win32/mkvtoolnix-unicode-4.3.0-setup.exe)
MKClean v0.5.7 or newer https://sourceforge.net/projects/matroska/files/mkclean/mkclean-win32.v0.6.0.zip/download (https://sourceforge.net/projects/matroska/files/mkclean/mkclean-win32.v0.6.0.zip/download)

Just pop the MKWDClean.exe file in the same directory as MKVFix.exe. If you don't, MKVFix will ask you where to find it.

You can download the GUI app from: www.chumpusrex.com/junk/MKVFix.exe (http://www.chumpusrex.com/junk/MKVFix.exe)

If you are worried about downloading exe files and would prefer to compile it yourself - then the source package is available from: www.chumpusrex.com/junk/MVVFix-src.rar (http://www.chumpusrex.com/junk/MVVFix-src.rar)
Please bear in mind that this was knocked up in a couple of hours and the code is seriously ugly. However, it seems to work with no glaring bugs.

Screenshots:
Pic1 (http://www.chumpusrex.com/junk/mkwdfix-1.png)
Pic2 (http://www.chumpusrex.com/junk/mkwdfix-2.png)
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on September 26, 2010, 05:18:08 AM
Nice.  Soooo simple to use too.  Love it.  Now I can go back to custom FW instead of using 1.03.40
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on September 26, 2010, 05:28:00 AM
Nice.  Soooo simple to use too.  Love it.  Now I can go back to custom FW instead of using 1.03.40

Hmmm......just did a file with it but once done it disappears....where did it go?
Title: Re: mkv header compression easy fixes using batch files
Post by: gffmac on September 26, 2010, 07:02:41 AM
Just an update here - But I've put together a small GUI for automating the remuxing process.

Just click on a directory - it scans it, identifies which files have header compression, and then remuxes them in the background (without having multiple console windows popping up).

It worked fine for me. Hopefully, some people will find it simpler than a batch file. As it really is a 2-click process.

It requires:
.NET framework v3.5 or v 4 (should be automatically installed by Windows update on XP and higher)
MKVToolNix v4.3.0 or newer http://www.bunkus.org/videotools/mkvtoolnix/win32/mkvtoolnix-unicode-4.3.0-setup.exe (http://www.bunkus.org/videotools/mkvtoolnix/win32/mkvtoolnix-unicode-4.3.0-setup.exe)
MKClean v0.5.7 or newer https://sourceforge.net/projects/matroska/files/mkclean/mkclean-win32.v0.6.0.zip/download (https://sourceforge.net/projects/matroska/files/mkclean/mkclean-win32.v0.6.0.zip/download)

Just pop the MKWDClean.exe file in the same directory as MKVFix.exe. If you don't, MKVFix will ask you where to find it.

You can download the GUI app from: www.chumpusrex.com/junk/MKVFix.exe (http://www.chumpusrex.com/junk/MKVFix.exe)

If you are worried about downloading exe files and would prefer to compile it yourself - then the source package is available from: www.chumpusrex.com/junk/MVVFix-src.rar (http://www.chumpusrex.com/junk/MVVFix-src.rar)
Please bear in mind that this was knocked up in a couple of hours and the code is seriously ugly. However, it seems to work with no glaring bugs.

Screenshots:
Pic1 (http://www.chumpusrex.com/junk/mkwdfix-1.png)
Pic2 (http://www.chumpusrex.com/junk/mkwdfix-2.png)

Just tried your gui and im getting this error on the only file that reported needing fixing
15:56:08: MkWDclean has exited with code -1073741819
15:56:08: MkWDClean returned a failure code

Ive been searching around and it seems to be something to do with subtitles.
Title: Re: mkv header compression easy fixes using batch files
Post by: ChumpusRex on September 26, 2010, 08:47:54 AM
Quote
Hmmm......just did a file with it but once done it disappears....where did it go?

Are you sure that the file has gone?

During processing, a temporary file called 'clean.<old file>' is created.

Once processing is complete - the temporary file is double checked for completeness. Once the file has been validated, the old file is deleted, and the clean file renamed to take its place.
Title: Re: mkv header compression easy fixes using batch files
Post by: ChumpusRex on September 26, 2010, 09:47:05 AM
Just tried your gui and im getting this error on the only file that reported needing fixing
15:56:08: MkWDclean has exited with code -1073741819
15:56:08: MkWDClean returned a failure code

Ive been searching around and it seems to be something to do with subtitles.

Error code -1073741819 (or 0xC0000005) means 'access violation'. This means that the program has crashed due to a bug in the program.

Unfortunately, I don't really have any good suggestions. Possibilities are that you have some obscure MKV file format that even the Matroska tools can't handle it; that your file is corrupted; or your computer is malfunctioning (e.g. overclocked, faulty RAM).

You could try getting 'mkvalidator' and seeing what it says about the file.

For what it's worth, I've updated the program, so it's got more detailed logging, so any further problems should be more traceable.

Log example (http://www.chumpusrex.com/junk/mkwdfix-3.png)
Log example2 (http://www.chumpusrex.com/junk/mkwdfix-2.png)
Title: Re: mkv header compression easy fixes using batch files
Post by: gffmac on September 26, 2010, 01:11:49 PM
Just tried your gui and im getting this error on the only file that reported needing fixing
15:56:08: MkWDclean has exited with code -1073741819
15:56:08: MkWDClean returned a failure code

Ive been searching around and it seems to be something to do with subtitles.

Error code -1073741819 (or 0xC0000005) means 'access violation'. This means that the program has crashed due to a bug in the program.

Unfortunately, I don't really have any good suggestions. Possibilities are that you have some obscure MKV file format that even the Matroska tools can't handle it; that your file is corrupted; or your computer is malfunctioning (e.g. overclocked, faulty RAM).

You could try getting 'mkvalidator' and seeing what it says about the file.

For what it's worth, I've updated the program, so it's got more detailed logging, so any further problems should be more traceable.

Log example (http://www.chumpusrex.com/junk/mkwdfix-3.png)
Log example2 (http://www.chumpusrex.com/junk/mkwdfix-2.png)

Nice update ChumpusRex I have ran it through mkvalidator and appears to be valid:
mkvalidator 0.2.3: the file appears to be valid
Track #1 V_MPEG4/ISO/AVC 700517 bits/s
Track #2 A_DTS 1509002 bits/s
Track #3 S_TEXT/UTF8 29 bits/s
file created with libebml v1.0.0 + libmatroska v1.0.0 / mkvmerge v4.2.0 ('no talking') built on July 29 2010 ...

And im using a laptop with no overclocking whatsoever core2duo 2.6ghz 4gb ram, plenty of hd space.
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on September 26, 2010, 01:43:11 PM
Are you sure that the file has gone?

During processing, a temporary file called 'clean.<old file>' is created.

Once processing is complete - the temporary file is double checked for completeness. Once the file has been validated, the old file is deleted, and the clean file renamed to take its place.


Yeah I  read the log and it says it did not succeed in fixing the file.  That one has been giving me problems for a long time. 

I'll keep this though as it is the nicest and easiest MKV fix I have seen so far.
Title: Re: mkv header compression easy fixes using batch files
Post by: ChumpusRex on September 28, 2010, 02:21:26 PM
Quote
Just tried your gui and im getting this error on the only file that reported needing fixing
15:56:08: MkWDclean has exited with code -1073741819
15:56:08: MkWDClean returned a failure code

I have confirmed that this is a bug in mkWDclean 0.6.0.

I can reproduce it by muxing a file in a particular way with MKVMerge 4.3.0.

mkWDclean 0.5.7 doesn't have this bug, and remuxes all my files fine - whereas 0.6.0 crashes on quite a few - especially those muxed with mkvMerge 4.3.0
Title: Re: mkv header compression easy fixes using batch files
Post by: gffmac on September 29, 2010, 03:27:42 AM
Quote
Just tried your gui and im getting this error on the only file that reported needing fixing
15:56:08: MkWDclean has exited with code -1073741819
15:56:08: MkWDClean returned a failure code

I have confirmed that this is a bug in mkWDclean 0.6.0.

I can reproduce it by muxing a file in a particular way with MKVMerge 4.3.0.

mkWDclean 0.5.7 doesn't have this bug, and remuxes all my files fine - whereas 0.6.0 crashes on quite a few - especially those muxed with mkvMerge 4.3.0

Thanks ChumpusRex I will test this out when I get home later.
Title: Re: mkv header compression easy fixes using batch files
Post by: gffmac on September 30, 2010, 08:44:21 AM
Quote
Just tried your gui and im getting this error on the only file that reported needing fixing
15:56:08: MkWDclean has exited with code -1073741819
15:56:08: MkWDClean returned a failure code

I have confirmed that this is a bug in mkWDclean 0.6.0.

I can reproduce it by muxing a file in a particular way with MKVMerge 4.3.0.

mkWDclean 0.5.7 doesn't have this bug, and remuxes all my files fine - whereas 0.6.0 crashes on quite a few - especially those muxed with mkvMerge 4.3.0

Working perfect now! thx man
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on September 30, 2010, 09:06:45 AM
Where can I get that mkWDclean 0.5.7?
I can only find v0.6 on their site.

Thanks
Title: Re: mkv header compression easy fixes using batch files
Post by: ChumpusRex on September 30, 2010, 02:43:22 PM
http://sourceforge.net/projects/matroska/files/mkclean/mkclean-win32.v0.5.7.zip/download (http://sourceforge.net/projects/matroska/files/mkclean/mkclean-win32.v0.5.7.zip/download)

I've also updated the GUI (fixed a few bugs, added warning about dodgy mkwdclean, made it a bit slicker, rewrote large chunks of it).
www.chumpusrex.com/junk/MKVFix.exe (http://www.chumpusrex.com/junk/MKVFix.exe)
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on October 01, 2010, 02:33:23 PM
Tx.  Worked great this time.
Title: Re: mkv header compression easy fixes using batch files
Post by: ChumpusRex on October 05, 2010, 12:18:50 PM
Hmm. Something strange going on here.
I've just found a whole bunch of files that don't play on my WDTV live - either with firmware 1.2.21 or with 1.3.41.

After a bit of investigation - I've found that these are some of the files that were processed with mkwdclean 0.5.7. So, it seems that mkWDclean is doing something that the WDTV doesn't always like.

Fortunately, MKVMerge could rescue the files without much difficulty.

Anyway, seeing as I had to automate MKVmerge to get it to remux the files - I've now removed mkWDclean from my program and replaced it with MKVmerge.

As a bonus mkvmerge sees to run much faster than mkwdclean. The take-home-message is that mkclean isn't really ready for the primetime just yet - broken files and unexpected crashes don't impress me that much.

New download link:
http://www.chumpusrex.com/junk/MKVFix.exe (http://www.chumpusrex.com/junk/MKVFix.exe)
Title: Re: mkv header compression easy fixes using batch files
Post by: plumb121 on October 14, 2010, 09:21:35 AM

Thanks for the work you have done on this, could you explain how to put your program and the others together so that i can try this on some non-working files i have, as my knowledge is not that great on this. Thanks.
Title: Re: mkv header compression easy fixes using batch files
Post by: jmpiers on October 14, 2010, 03:04:36 PM
Download: mkvtoolnix-unicode-4.3.0-setup.exe from http://www.videohelp.com/tools/MKVtoolnix/old-versions then do an install (not just extract) then run the app point it to your MKV's and let it run. Worked great for me, just took me a long time to find the mkvtoolnix (the main link didnt work for me)
Title: Re: mkv header compression easy fixes using batch files
Post by: allstar1 on October 15, 2010, 11:37:29 AM
Chumpus thanks a lot for the app,was waiting for something like this to come a long,so thanks again. I don't know how to point it to my mkvtoolnix folder,don't see any "file locations tab".



Edit : Seems it HAS to be installed and not just extracted, that fixed it for me.
Title: Re: mkv header compression easy fixes using batch files
Post by: Flarup on November 04, 2010, 06:07:19 AM
I have an errors with some of mine MKV's

after I have added some extra subtitles or made some chaptors in MKVmerge I have to use this MKVfix tool

Why ?

When I use this tool somtimes I got an error for some of the files with the message "The output file was shorter than the original. The reason for this is not clear, but something bad probably happened." Can anybody please tell me why ? and how i fix this ?
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on November 04, 2010, 06:36:04 AM
Flarup
Don't forget to disable the Header Compression in both Audio and Video when using MKVMerge.  If not, your MKV won't work.
Title: Re: mkv header compression easy fixes using batch files
Post by: Flarup on November 04, 2010, 06:47:23 AM
Flarup
Don't forget to disable the Header Compression in both Audio and Video when using MKVMerge.  If not, your MKV won't work.

could you please tell me whre i do this :)
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on November 04, 2010, 07:37:50 AM
A picture is worth a 1000 words
(http://a.imageshack.us/img825/5458/26082010093450.png)
Title: Re: mkv header compression easy fixes using batch files
Post by: Flarup on November 04, 2010, 07:47:41 AM
Thank You vevry much you are the man :)
Title: Re: mkv header compression easy fixes using batch files
Post by: lagunero on November 17, 2010, 11:10:20 PM
A picture is worth a 1000 words
(http://a.imageshack.us/img825/5458/26082010093450.png)

Thank you, you make my day, i wasnt unable to see my movie INCEPTION always did i started only saw a black screen, no sound, no video, amd i did what you post here and works perfect. Thank you

Pd: Sorry for my english im from Mexico.
Title: Re: mkv header compression easy fixes using batch files
Post by: Dion on November 18, 2010, 12:34:55 AM
A picture is worth a 1000 words
(http://a.imageshack.us/img825/5458/26082010093450.png)

Thank you, you make my day, i wasnt unable to see my movie INCEPTION always did i started only saw a black screen, no sound, no video, amd i did what you post here and works perfect. Thank you

Pd: Sorry for my english im from Mexico.

Inception isn't out.. You dirty pirate..  Anyways.. New Firmware is out.. So this isn't required anymore.
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on November 18, 2010, 03:22:44 AM
Still required for those who prefer the tweaks of the custom firmware.  Many are like myself and prefer to stick with B-Rad's firmware.

And please refrain from insulting other members.
Title: Re: mkv header compression easy fixes using batch files
Post by: Dion on November 18, 2010, 03:19:15 PM
Still required for those who prefer the tweaks of the custom firmware.  Many are like myself and prefer to stick with B-Rad's firmware.

And please refrain from insulting other members.

Well then install 4.4.0 as it gives you the option to always disable it.  And its not an insult when its the truth.
Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on November 18, 2010, 03:55:08 PM
Not many here are NOT pirates.  Whether you download your movies or rip your own DVDs, it is still piracy.  But if you can get legal movies I would be happy to follow your lead.  The only way you will not be a pirate is if you play/stream stuff like Netflix where you pay a fee and watch what ever.  Not many doing only that I'm sure.
Title: Re: mkv header compression easy fixes using batch files
Post by: tunly on December 02, 2010, 08:01:00 PM
did this for myself since i am a really lazy person and decided to share it with others. i wanted an easy way to quickly fix multiple mkv files so they would work on my wdtv. these two solutions work on every mkv in a folder and subfolders. most of the work is not mine, i had problems getting the original batch files i found to work so i just fixed, modified, cut and pasted into new ones which worked for me.

firstly from the matroska website http://www.matroska.org/downloads/mkclean.html (http://www.matroska.org/downloads/mkclean.html) is a tool called mkclean. in this download zip is another tool mkWDclean.exe
make a folder and put mkWDclean.exe in it then create a batch file and paste and copy the code below into it.
Code: [Select]
FOR /F "delims=*" %%A IN ('dir /b /s *.mkv') DO CALL:WDTVFIX "%%A"
START "" logging.txt
GOTO :eof
:WDTVFIX
mkWDclean --optimize %~dpnx1 %~dpn1_fixed.mkv
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> logging.txt
goto :eof)
ECHO OFF
REM remove the REM's below to delete original files
REM if exist "%~dpn1_fixed.mkv" (
REM del "%~dpnx1")
ECHO Processing of %~nx1 successful! >> logging.txt
goto :eof

save the batch file and double click to run it. (if you should want to stop it part way through the keyboard shortcut is Ctl-C)

what it does is for every file *.mkv it finds it runs it through mkWDclean and saves the output as *_fixed.mkv
it does not delete the original files unless you remove the REM from the bottom so it reads
Code: [Select]
FOR /F "delims=*" %%A IN ('dir /b /s *.mkv') DO CALL:WDTVFIX "%%A"
START "" logging.txt
GOTO :eof
:WDTVFIX
mkWDclean --optimize %~dpnx1 %~dpn1_fixed.mkv
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> logging.txt
goto :eof)
ECHO OFF
REM remove the REM's below to delete original files
if exist "%~dpn1_fixed.mkv" (
del "%~dpnx1"
ECHO Processing of %~nx1 successful! >> logging.txt
goto :eof

an alternate method already used by others on this site uses mkvmerge. i just created a batch file to automate it.
you need the latest mkvtoolnix from their website http://www.bunkus.org/videotools/mkvtoolnix/downloads.html (http://www.bunkus.org/videotools/mkvtoolnix/downloads.html)
there are two batch files depending upon whether you use the installer or the standalone 7zip archive

installed version
create a folder and make a batch file containing the code below. put your mkv files in the folder and run the batch file to fix them.

Code: [Select]
REM Whipped up by TEKNO to fix MKV header compression issues on Standalone media players!
REM fixMKV version 1.2
REM Requires MKVToolnix v4.1.1 INSTALLED (it auto detects where)
@ECHO OFF
cd "%~dp0"
SET KEY="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\mmg.exe"
FOR /F "tokens=2*" %%A IN ('REG QUERY %KEY%') DO SET MKVTOOLPATH=%%B
ECHO MKVToolnix found at %MKVTOOLPATH% > logging.txt
FOR /F "delims=*" %%A IN ('dir /b /s *.MKV') do CALL :MKVFIXMUX "%%A" "%MKVTOOLPATH%"
START "" logging.txt
GOTO :eof
:MKVFIXMUX
"mkvmerge.exe" -o "%~dpn1_fix.mkv" --engage keep_bitstream_ar_info -A -S --compression -1:none "%~dpnx1" -D -S --compression -1:none "%~dpnx1" -A -D --compression -1:none "%~dpnx1"
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> logging.txt
goto :eof)
REM if exist "%~dpn1_fix.mkv" (
REM del "%~dpnx1")
ECHO Processing of %~nx1 successful! >> logging.txt
goto :eof

in the original version the link to the mkvmerge program was referenced by "%~dp2mkvmerge.exe" which did not work on my system(s) but did when i changed it to "mkvmerge.exe" (when you install mkvtoolnix it creates a PATH reference to its install folder.

standalone version
create a folder and extract mkvtoolnix-unicode-4.2.0.7z into it so it is in a sub-folder called mkvtoolnix. the archive uses 7zip http://www.7-zip.org/download.html (http://www.7-zip.org/download.html).
create a batch file in the folder and paste the code below into it. launch the batch file to fix all mkv files in the directory.

Code: [Select]
REM Whipped up by TEKNO to fix MKV header compression issues on Standalone media players!
REM MKVfix version 1.2
REM For use with the ZIPPED version of MKVToolnix v4.1.1 or greater
REM Change the "SET MKVTOOLPATH =" to the DIRECTORY that you have unzipped MKVToolnix too!
@ECHO OFF
cd "%~dp0"
SET MKVTOOLPATH=%~dp0mkvtoolnix
ECHO MKVToolnix found at %MKVTOOLPATH% > logging.txt
FOR /F "delims=*" %%A IN ('dir /b /s *.MKV') do CALL :MKVFIXMUX "%%A" "%MKVTOOLPATH%"
START "" logging.txt
GOTO :eof
:MKVFIXMUX
%MKVTOOLPATH%\mkvmerge.exe -o "%~dpn1_fix.mkv" --engage keep_bitstream_ar_info -A -S --compression -1:none "%~dpnx1" -D -S --compression -1:none "%~dpnx1" -A -D --compression -1:none "%~dpnx1"
if not errorlevel 0 (
ECHO Failed on %~nx1 remux! >> logging.txt
goto :eof)
REM if exist "%~dpn1_fix.mkv" (
REM del "%~dpnx1")
ECHO Processing of %~nx1 successful! >> logging.txt
goto :eof

again to get it to delete the originals delete the "REM " from the two lines so they are
Code: [Select]
if exist "%~dpn1_fix.mkv" (
del "%~dpnx1")
i had two problems with the original version of this firstly the SET MKVTOOLPATH= was SET MKVTOOLPATH = , it didn't like the spaces. and secondly it again failed to reference mkvmerge successfully.
hopefully this will be of use to someone until wd gets round to adding support for header compression to their firware; but i will not be holding my breath.

in terms of speed the mkvmerge method is faster.

plz help in using mkvwdclean.exe, mkvfix.exe by picture. i am from Vietnam
Title: Re: mkv header compression easy fixes using batch files
Post by: tunly on December 02, 2010, 08:06:24 PM
plz help in using mkvwdclean.exe, mkvfix.exe by picture. i am from Vietnam
Title: Re: mkv header compression easy fixes using batch files
Post by: Stealth3si on January 03, 2011, 05:17:45 PM
I could be wrong, but the MKVs' headers are still compressed when using MKVToolnix 4.2.0 and above with MKV WD Fix 0.1.2. So I installed MKVtoolnix 4.1.0 and below (but replaced MKVinfo.exe with the newest version) and all is OK.
Title: Re: mkv header compression easy fixes using batch files
Post by: syncronized77 on January 25, 2011, 05:37:53 PM
Hey guys,

I'm new here...I've got the WDTV V1 that is experiencing unable to play the new MKV files with the new header compression...

So to fix this....all I need are the following:

1 MKVFix GUI
2 mkvtoolnix unicode 4.3.0

Place both of them in the same folder and use the "header compression" only??

(http://i789.photobucket.com/albums/yy171/syncronized77/Cleaning%20House/WDTV.jpg)
Title: Re: mkv header compression easy fixes using batch files
Post by: schnoid on January 29, 2011, 08:21:45 AM
Thanks RavRob! I know I'm months behind on this, but I guess I hadn't noticed that there was all this stuff going on with muxing MKV files. I believe when I upgraded to Win 7 I downloaded the new version of MKVtoolnix and I was going nuts trying to figure out why none of my newly muxed movies would play. I thought there was something wrong with my computer or something but I guess I should've come here first. Once I tried what was recommended (turning off compression) all my MKVs work perfectly again! It's kind of annoying to have to set each track separately but oh well. I'll deal for now. Thanks again! Shabbat Shalom :)
Title: Re: mkv header compression easy fixes using batch files
Post by: laurh on February 17, 2011, 01:47:01 PM
I get stucked on analising files. I have in the same directory MKVFix.exe, mkclean.exe and mkWDclean.exe.
Can somebody help me please ?
Title: Re: mkv header compression easy fixes using batch files
Post by: caust1c on May 10, 2011, 01:11:13 PM
I have used this before to great success but recently reinstalled windows 7.  Now, despite having installed MKVtoolsNix and also trying to copy the files directly into the MKVFix folder, it keeps saying it cannot find MKVinfo.exe (MKVToolsNix not installed).  The log shows
Quote
MKVWDFix v0.1.2
3:08:35 PM: Program started

3:08:38 PM: MKVToolnix not found! Please install MKVToolnix before continuing.

3:08:38 PM: Please find the MKVInfo.exe executable file before continuing. Use the file locations tab to select the file.

Where is the file locations tab? Am I blind??
Title: Re: mkv header compression easy fixes using batch files
Post by: friv on May 10, 2011, 06:04:14 PM


Great, my problem was solved. Thank for share
friv (http://www.frivmini.com) | friv 4 (http://www.friv4.info)
Title: Re: mkv header compression easy fixes using batch files
Post by: blondsta on June 10, 2011, 11:29:19 AM
http://sourceforge.net/projects/matroska/files/mkclean/mkclean-win32.v0.5.7.zip/download (http://sourceforge.net/projects/matroska/files/mkclean/mkclean-win32.v0.5.7.zip/download)

I've also updated the GUI (fixed a few bugs, added warning about dodgy mkwdclean, made it a bit slicker, rewrote large chunks of it).
www.chumpusrex.com/junk/MKVFix.exe (http://www.chumpusrex.com/junk/MKVFix.exe)

Thank you very very much  :D
Title: Re: mkv header compression easy fixes using batch files
Post by: johnblox on June 17, 2011, 11:54:56 PM
I have used this before to great success but recently reinstalled windows 7.  Now, despite having installed MKVtoolsNix and also trying to copy the files directly into the MKVFix folder, it keeps saying it cannot find MKVinfo.exe (MKVToolsNix not installed).  The log shows
Quote
MKVWDFix v0.1.2
3:08:35 PM: Program started

3:08:38 PM: MKVToolnix not found! Please install MKVToolnix before continuing.

3:08:38 PM: Please find the MKVInfo.exe executable file before continuing. Use the file locations tab to select the file.

Where is the file locations tab? Am I blind??

ditto - program doesn't work (un/re installed mkvtoolnix) - anyone know of any other programs that DO work ? (I do wish people wouldn't bother wasting their time writing programs that don't work, it just wastes everyone else's time installing it and wondering why it doesn't work - if you can't code & test competently then please stick to gardening!)

echo %path%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind
owsPowerShell\v1.0\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\MKVtoolnix



Title: Re: mkv header compression easy fixes using batch files
Post by: RavRob on June 18, 2011, 03:05:04 AM
You can do it manually with MKVMerge.  Just disable header compression and remux.
Title: Re: mkv header compression easy fixes using batch files
Post by: Senseohasser on July 02, 2011, 01:35:04 AM
I get stucked on analising files. I have in the same directory MKVFix.exe, mkclean.exe and mkWDclean.exe.
Can somebody help me please ?

Same here:

I'm trying to use MKVFIX.exe but it shows no results at all although there are many files in the scanned directory containing stripped headers.

The log says:

MKVWDFix v0.1.2
10:38:43: Program started
10:38:43: mkvinfo version 4.8.0 identified. Minimum required version 4.3.0
10:38:53: Searching for files in "Z:\Aktuell"
10:38:53: Search completed. 29 matroska files identified.
10:38:53: Analysis of files started
10:38:53: Running MKVInfo on "Z:\Aktuell\Movie.mkv"
10:38:53: MKVInfo has exited with code 0

 ???
Title: Re: mkv header compression easy fixes using batch files
Post by: ChumpusRex on September 12, 2011, 02:58:06 PM
In the unlikely event that anyone is still interested, I've probably fixed 2 bugs:

1. Unable to find MKVToolnix on 64 bit systems.
2. Unable to analyse MKV files on non-English systems.

Added a new feature:

1. Automatic reordering of audio/subtitle streams so that your preferred language is default when played back on WDTV.

URL is the same: http://www.chumpusrex.com/junk/MKVFix.exe (http://www.chumpusrex.com/junk/MKVFix.exe)
Title: Re: mkv header compression easy fixes using batch files
Post by: gogkai on September 22, 2011, 07:25:30 AM
Thanks a lot for this,very helpful.  :D
Title: Re: mkv header compression easy fixes using batch files
Post by: 88keyz on September 23, 2011, 04:16:51 PM
If you are having problems with MKVFix detecting your installation of MKVtoolnix then you can run one of these reg files.  Just edit for your path.

For 32-bit systems (save as x86.reg):
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\mkvmergeGUI]

[HKEY_LOCAL_MACHINE\SOFTWARE\mkvmergeGUI\GUI]
"installation_path"="C:\\Path to\\MKVtoolnix"

For 64-bit systems (save as x64.reg):
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\mkvmergeGUI]

[HKEY_LOCAL_MACHINE\SOFTWARE\mkvmergeGUI\GUI]
"installation_path"="C:\\Path to\\MKVtoolnix"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\mkvmergeGUI]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\mkvmergeGUI\GUI]
"installation_path"="C:\\Path to\\MKVtoolnix"

Works perfect and no errors on program startup.
Title: Re: mkv header compression easy fixes using batch files
Post by: userdude on October 22, 2011, 01:25:07 PM
In the unlikely event that anyone is still interested, I've probably fixed 2 bugs:

1. Unable to find MKVToolnix on 64 bit systems.
2. Unable to analyse MKV files on non-English systems.

Added a new feature:

1. Automatic reordering of audio/subtitle streams so that your preferred language is default when played back on WDTV.

URL is the same: http://www.chumpusrex.com/junk/MKVFix.exe (http://www.chumpusrex.com/junk/MKVFix.exe)


God sent....

Finally something simple, that works ( Wdtv gen 2 / non live)

Thank you
Title: Re: mkv header compression easy fixes using batch files
Post by: cmdwedge on November 20, 2011, 06:57:59 PM
In the unlikely event that anyone is still interested, I've probably fixed 2 bugs:

1. Unable to find MKVToolnix on 64 bit systems.
2. Unable to analyse MKV files on non-English systems.

Added a new feature:

1. Automatic reordering of audio/subtitle streams so that your preferred language is default when played back on WDTV.

URL is the same: http://www.chumpusrex.com/junk/MKVFix.exe (http://www.chumpusrex.com/junk/MKVFix.exe)

Champus - I went to your site in the hopes of finding a 'donate' link, as I'd really like to throw a couple of bucks your way for this great program. Feel free to PM me your PayPal details.

Cheers, Phil
Title: Re: mkv header compression easy fixes using batch files
Post by: Someone on November 27, 2011, 12:16:46 PM
hello guys, question:
i used mkvmerge gui v4.4.0, i added the mkv (for example kung fu panda with both english and greek audio), i removed the english audio, left only the greek audio and the video and pushed tha button "start muxing", when it finished i couldn't open it with KMplayer, i only could with VLC. I asked around in some forums and they telled me that mkvmerge 4.3 and above has as default the header compression. The matter is that i have muxed all the animations in order tou remove the english audio and leave the greek only. They are too many to remux them again one by one with mkvmerge. What i have to do is open the folder with the mkvs with mkvfix that was posted before, select the Header compression (am i right?) and then push "clean files"?? I don't want to do something wrong cuz they are too many to download them again or remux them again one by one with mkvmerge ;D thanks in advance
Title: Re: mkv header compression easy fixes using batch files
Post by: krajicekp on December 23, 2011, 02:06:35 AM
hello everyone,

i tried MKVWDFix v0.1.4 to get the job done, but still, i did not pass throug analyse phase,
I have W7 ultimate x64, non-english version, i still get this log whatewer i do

Quote
MKVWDFix v0.1.4
10:54:40: Program started
10:54:40: Registry: LOCAL_MACHINE\SOFWTWARE\mkvmergeGUI indicated MKVToolnix installed
10:54:41: mkvinfo version 5.2.0 identified. Minimum required version 4.3.0
10:54:41: Found MKVInfo.exe in C:\MKVtoolnix
10:54:54: Searching for files in "C:\abcds"
10:54:54: Search completed. 4 matroska files identified.
10:54:54: Analysis of files started
10:54:54: Running MKVInfo on "C:\abcds\aaaa.mkv"
10:54:54: MKVInfo has exited with code 0 (View output)
Title: Re: mkv header compression easy fixes using batch files
Post by: Aedaeum on April 05, 2012, 07:00:53 PM
Symptoms: Hanging on: "analyzing files..." or no files showing up on the list

Anyone having the above problems with the MKV WD Fix v0.1.4 make sure you're using an earlier version of mkvtoolnix, otherwise the program won't find any files. Using the 4.3.0 version works just fine. I don't see a need for using version 5 unless you're using it for other purposes then in tandem with the mkvfix tool.

Hope this helps. I just recently re-installed windows and just figured it out.
Title: Re: mkv header compression easy fixes using batch files
Post by: Git on April 21, 2012, 08:19:18 PM
Yes - I was having the same issue.  64 bit system, would just hang on "analyzing files"

I uninstalled everything and then installed mkvtoolnix  4.3.0 from this page along with MKV WD Fix 1.4 and it works great

thanks for the help   :)

http://www.bunkus.org/videotools/mkvtoolnix/win32/

Quick question - do I just need to run it using "Header compression only" or should I use the Header compressed and mkWDcleanfiles option.  I couldnt find any documentation