Author Topic: mkv header compression easy fixes using batch files  (Read 54132 times)

October 14, 2010, 03:04:36 PM
Reply #30

jmpiers

  • Newbie

  • Offline
  • *

  • 1
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)

October 15, 2010, 11:37:29 AM
Reply #31

allstar1

  • Newbie

  • Offline
  • *

  • 3
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.
« Last Edit: October 15, 2010, 11:49:45 AM by allstar1 »

November 04, 2010, 06:07:19 AM
Reply #32

Flarup

  • Newbie

  • Offline
  • *

  • 18
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 ?

November 04, 2010, 06:36:04 AM
Reply #33

RavRob

  • DeSpammer
  • Hero Member

  • Offline
  • ****

  • 1723
Flarup
Don't forget to disable the Header Compression in both Audio and Video when using MKVMerge.  If not, your MKV won't work.
Windows 7 Ultimate with SP1
WDTV Live
1.02.21 WDLXTV 0.5.1.4 (Beta)
Linksys - WUSB600N USB Adapter
DLink - Dir-655 Router
Atheros - AR8131 PCI-E Gigabit Ethernet Controller (NDIS 6.20)
XBMC - The Future of Television

November 04, 2010, 06:47:23 AM
Reply #34

Flarup

  • Newbie

  • Offline
  • *

  • 18
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 :)

November 04, 2010, 07:37:50 AM
Reply #35

RavRob

  • DeSpammer
  • Hero Member

  • Offline
  • ****

  • 1723
Windows 7 Ultimate with SP1
WDTV Live
1.02.21 WDLXTV 0.5.1.4 (Beta)
Linksys - WUSB600N USB Adapter
DLink - Dir-655 Router
Atheros - AR8131 PCI-E Gigabit Ethernet Controller (NDIS 6.20)
XBMC - The Future of Television

November 04, 2010, 07:47:41 AM
Reply #36

Flarup

  • Newbie

  • Offline
  • *

  • 18
Thank You vevry much you are the man :)

November 17, 2010, 11:10:20 PM
Reply #37

lagunero

  • Newbie

  • Offline
  • *

  • 3
A picture is worth a 1000 words


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.

November 18, 2010, 12:34:55 AM
Reply #38

Dion

  • Newbie

  • Offline
  • *

  • 42
A picture is worth a 1000 words


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.

November 18, 2010, 03:22:44 AM
Reply #39

RavRob

  • DeSpammer
  • Hero Member

  • Offline
  • ****

  • 1723
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.
Windows 7 Ultimate with SP1
WDTV Live
1.02.21 WDLXTV 0.5.1.4 (Beta)
Linksys - WUSB600N USB Adapter
DLink - Dir-655 Router
Atheros - AR8131 PCI-E Gigabit Ethernet Controller (NDIS 6.20)
XBMC - The Future of Television

November 18, 2010, 03:19:15 PM
Reply #40

Dion

  • Newbie

  • Offline
  • *

  • 42
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.

November 18, 2010, 03:55:08 PM
Reply #41

RavRob

  • DeSpammer
  • Hero Member

  • Offline
  • ****

  • 1723
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.
« Last Edit: December 03, 2010, 03:24:42 AM by RavRob »
Windows 7 Ultimate with SP1
WDTV Live
1.02.21 WDLXTV 0.5.1.4 (Beta)
Linksys - WUSB600N USB Adapter
DLink - Dir-655 Router
Atheros - AR8131 PCI-E Gigabit Ethernet Controller (NDIS 6.20)
XBMC - The Future of Television

December 02, 2010, 08:01:00 PM
Reply #42

tunly

  • Newbie

  • Offline
  • *

  • 2
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 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
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.
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

December 02, 2010, 08:06:24 PM
Reply #43

tunly

  • Newbie

  • Offline
  • *

  • 2
plz help in using mkvwdclean.exe, mkvfix.exe by picture. i am from Vietnam
« Last Edit: December 02, 2010, 08:14:06 PM by tunly »

January 03, 2011, 05:17:45 PM
Reply #44

Stealth3si

  • Newbie

  • Offline
  • *

  • 3
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.