mkv2tivomp4.bat

Discussion in 'TiVo Home Media Features & TiVoToGo' started by orangeboy, May 8, 2010.

  1. orangeboy

    orangeboy yes, I AM orangeboy!

    4,089
    0
    Apr 19, 2004
    East Moline, IL

    Advertisements

    Unfortunately, there's still nothing that jumps out at me as to why mp4creator would be down-mixing to stereo. It looks like mp4creator can create debug messages by using a '-verbose=" switch. Changing line 279 to include that switch may shed some light:

    Old:
    Code:
    	IF EXIST %VideoTrackName% (
    		IF EXIST %AudioTrackName% (
    			ECHO.
    			ECHO Extracted audio and video tracks found.
    			ECHO Combining to create MP4 file...
    			ECHO.
    			GOTO %Muxer%
    			:mp4creator
    			%mp4creatorPath% -create=%VideoTrackName% -rate=%vfps% -timescale=%vtimescale% -optimize -use64bits -mpeg4-video-profile=4.1 %OutputFullName% >>CON 2>&1
    			%mp4creatorPath% -create=%AudioTrackName% -optimize %OutputFullName% >>CON 2>&1
    			GOTO Cleanup
    
    New:
    Code:
    	IF EXIST %VideoTrackName% (
    		IF EXIST %AudioTrackName% (
    			ECHO.
    			ECHO Extracted audio and video tracks found.
    			ECHO Combining to create MP4 file...
    			ECHO.
    			GOTO %Muxer%
    			:mp4creator
    			%mp4creatorPath% -create=%VideoTrackName% -rate=%vfps% -timescale=%vtimescale% -optimize -use64bits -mpeg4-video-profile=4.1 %OutputFullName% >>CON 2>&1
    			%mp4creatorPath% -create=%AudioTrackName% -optimize %OutputFullName% -verbose=1 >>CON 2>&1
    			GOTO Cleanup
    
    The above sets the debugging level to 1, which I assume produces the least amount of debugging messages. It may be a tedious task, but running the batch several times increasing the verbosity may be needed to get the messages needed.

    The only thought/theory I have is that the channels are seen as being out of order. I found this table that shows a slight difference between AC3 and DTS mappings:

    Code:
    Format		Chan 0	Chan 1	Chan 2	Chan 3	Chan 4	Chan 5
    5.1 WAV		FL	FR	FC	LFE	SL	SR
    5.1 AC3		FL	FC	FR	SL	SR	LFE
    5.1 DTS		FC	FL	FR	SL	SR	LFE
    5.1 AAC		FC	FL	FR	SL	SR	LFE
    5.1 AIFF	FL	SL	FC	FR	SR	LFE
    
    FL : Front Left
    FC : Front Center
    FR : Front Right
    SL : Surround Left
    SR : Surround Right
    LFE : Low Frequency Effects (Sub)
    
    I'm not putting too much faith in that theory, since I believe that labels like "FL" or "FC" are for the benefit of human understanding, and having incorrect mappings would only result in all channels still being present, but the sound being incorrect for the listener...
     
  2. thekayman

    thekayman New Member

    5
    0
    Jun 20, 2009
    I set verbose to 1 and got a whole heap of stuff (attached as text file)

    dont know if that helps in anyway I couldnt see any info about text although there was prob more info above but i didnt have a big enough buffer i think.
     

    Attached Files:

  3. rfryar

    rfryar My Media, My Way

    244
    5
    Feb 15, 2008
    Cottage...
    Just a quick change for those using MP4Box. For some reason it will default to using ISOM as the Major Brand. This is never supposed to be used as the Major Brand according to the specs.

    While I had this running fine for a number of months, once I started to use a program called MetaX to add image metadata to my movies the TiVo refused to recognize the files. I believe this was due to the invalid Major Brand tag. I have since updated this script to change MP4box to add:

    Code:
    -brand mp42
    This has resolved the tagged files from playing correctly on my TiVos. I am also going to look into MP4creator to see if it has similar issues.

    Rick
     
  4. orangeboy

    orangeboy yes, I AM orangeboy!

    4,089
    0
    Apr 19, 2004
    East Moline, IL
    Thanks Rick! Since I've never had any luck using mp4box, I've not explored all the options available. Input from folks like you is greatly appreciated!

    Edit: Have you tried
    Code:
    -brand avc1
    as well? I only ask because mediainfo tends to report "avc1" quite often with mkv files...
     
  5. boredsox38

    boredsox38 New Member

    9
    0
    Apr 7, 2007

    Advertisements

    I have been looking for a tool like this for sometime now. I am happy to find. I ran my first MKV file this morning using mp4box. It resulted in two diff files, an ac3 file and an .h264 file. How do I get both of these combined to mp4? Did I miss a step here? Thanks for you help and thanks for working on the program.
     
  6. ajayabb

    ajayabb Member

    431
    2
    Jan 11, 2007
    Moorestown NJ
    Interested to hear the answer as well. I have gotten this hiccup on a few of my MKV files while others have been fine.
     
  7. orangeboy

    orangeboy yes, I AM orangeboy!

    4,089
    0
    Apr 19, 2004
    East Moline, IL
    Tried replying earlier and wasn't successful (web page not available?!). Anyway, I can only suggest trying mp4creator. I've never had luck with mp4box, so I can't make recommendations for making it work.
     
  8. xyth

    xyth New Member

    9
    0
    Dec 19, 2009
    Sounds like eac2to.exe is extracting the video and sound from the .mkv, but mp4box isn't running so they are put back into the mp4 container. My first guess is you didn't get the path to the mp4box.exe file correct, so it is aborting the batch file. Open your mkv2tivomp4.ini file and confirm you have the path correct. It should look like this at the very end of the file:

    SET Muxer=mp4box
    SET mp4creatorPath="."
    SET mp4boxPath="C:\yourdirectory\mkv2mp4\MP4Box.exe"
    GOTO :EOF

    yourdirectory path is whatever leads you to the mkv2mp4 folder you created per the installation instructions.

    mp4box works fine for me, and I have used it for years in another batch file with a different extraction program. Good luck.
     
  9. orangeboy

    orangeboy yes, I AM orangeboy!

    4,089
    0
    Apr 19, 2004
    East Moline, IL
    Very good advice! :up:
    Also look at the end of the batch file besides the .ini file. The .ini file is only used to aid in the setup when a new version is released (it's been pretty dormant of late though).
     
  10. xyth

    xyth New Member

    9
    0
    Dec 19, 2009
    I too started having a few crashes with MP4Box, so after a few hours of debugging I offer a few suggestions that seemed to solve what might be more than one problem causing these crashes or non-writes. First, add the switch -new to the line where the mkv2tivomp4 batch file writes out the final file. Its the line above the cleanup section, and mine now looks like this:

    Code:
    %mp4boxPath% -add %VideoTrackName%:fps=%vfps% -add %AudioTrackName% -new %OutputFullName% -isma >>CON 2>&1
    That forces the creation of a new file, which seemed to the batch from blowing up at the beginning of the file output.

    Another issue is that I have found a lot of different builds of mp4box out there, even for a given version. Some versions compile in the needed dependencies into the .exe file, others require you add a few other dependence files (.dll and .patch) into the same directory as the mp4box.exe file. If you mix up the different versions of these dependencies, it will give you other errors.

    You can get the source code yourself and build a stable version, or if your lazy like me grab a version used in a current project on Sourceforge. I am using the files contained in the latest version of the Srtiphone project which can be found on Sourceforge. If your lost, search for Mp4box on Sourceforge and it will show you where the Srtiphone project is.

    Anyway, good luck, and thank to Orangeboy for this fine batch file.
     
  11. orangeboy

    orangeboy yes, I AM orangeboy!

    4,089
    0
    Apr 19, 2004
    East Moline, IL
    Thanks for sharing your findings! Any mp4box tweaks definitely helps.

    Yeah, I link to a specific site for mp4box to keep the experience a simple as possible. For those adventurous enough to build there own can do so; but *I* personally would rather not get involved with trying to troubleshoot mp4box of many different builds. If there's a definitive, stable build found to work better than whatever source I'm linking to (kurtnoise build I think?), I'll happily adjust the links, and suggest using that instead. I've set my local copy of mkv2mp4 to always use mp4creator after several unsuccessful attempts at using mp4box, so I am a bit out of my element with the latter.

    I'm happy to share what I can! :)
     
  12. xyth

    xyth New Member

    9
    0
    Dec 19, 2009
    I have been playing with the mp4creator option, and I agree it seems more stable. I do get an error when mp4creator combines to create the mp4 file. The error is: "Error decoding sei message". The resulting file seems to work well though, and I think the error happens because the output files were over 4 gigs.
     
  13. orangeboy

    orangeboy yes, I AM orangeboy!

    4,089
    0
    Apr 19, 2004
    East Moline, IL
    I've never found a good explanation for the "Error decoding sei message". I've ignored it. There appears to have been a patch created, but the link is 404.
     
  14. philhu

    philhu User Since Day ONE!

    972
    49
    Apr 11, 2001
    Funcity, AZ
    The location is no longer 404.

    It is a pointer in another forum. Go look!
     
  15. orangeboy

    orangeboy yes, I AM orangeboy!

    4,089
    0
    Apr 19, 2004
    East Moline, IL
    Sorry - I should have said the resulting (patch) link is 404.
     
  16. sirfracas

    sirfracas Member

    30
    5
    Apr 5, 2006
    . . Orangeboy. My wife finally became so frustrated with all the .mkv files having corrupt audio she waved her hand imperiously at me the other day and said, "Do some of that IT voodoo you do and fix the issue."

    Happy wife, happy life.

    P.S. I used MP4Box-0.4.6-rev2735 for those scoring at home and so far no issues.
     
  17. vincejose

    vincejose New Member

    1
    0
    Apr 18, 2011
    Just wanted to say thanks for the tool, I've used it on a couple files and it's worked beautifully.
     
  18. orangeboy

    orangeboy yes, I AM orangeboy!

    4,089
    0
    Apr 19, 2004
    East Moline, IL
    I happy to hear it!
     
  19. orangeboy

    orangeboy yes, I AM orangeboy!

    4,089
    0
    Apr 19, 2004
    East Moline, IL
    I just discovered that mkv2TiVomp4 also works on (compatible) m2ts files as well. eac3to has no problems extracting the proper audio and video tracks found in the ts container. This may have been common knowledge, but I hadn't opportunity to try until just recently.
     
  20. MrJedi

    MrJedi Member

    73
    1
    Apr 13, 2011
    Been using this with mp4creator the last two days with no issues. Thanks for the .bat and the Send To instructions :)
     

Share This Page

spam firewall

Advertisements