2007-05-17, 10:15 | Link #1 |
makes no files now
Join Date: May 2006
|
MKV to MP4 Guide
Recently there has been an upsurge of people asking how to convert MKV to MP4 so that they can play it on their XBOX360 or PS3 (You have to note that the PS3 does not support the High profile yet, in which most fansubs are encoded, so it's very likely that those files will not play unless they are re-encoded to the supported profile). So I have decided to put something like this us since it will be easier than having dozens of threads which try to achieve the same purpose. Also, scroll down to the very bottom to read a bit more...
Before you even start... Spoiler for boring stuff, read only if you actually want to know what you are getting yourself into:
What files do I need?
All these tools should suffice for all the tasks in this script. What do I do next then? The batch script executes different commands based on what media file you have, since not all of them can be treated the same. In this section I will explain how to identify them. The simplest approach would be to open the media file in Media Player Classic, right-click on the video and move to the Details tab. There you will see a basic description of the file. Type 1 Video: MPEG4 Video (H264) Audio: AAC - just remuxing needed Type 2 Video: MPEG4 Video (H264) Audio: MPEG Audio Layer 3 (aka MP3), Vorbis, AC3 or any others - audio transcoding to AAC needed, rest will be just remuxed Type 3a Video: XVID, DIVX or any others Audio: AAC - video transcoding needed, audio will be remuxed Type 3b Video: MPEG4 Video (H264), XVID, DIVX or any others Audio: AAC Subtitle: Advanced SubStation Alpha or any others - video transcoding needed while hardsubbing subtitles, audio will be remuxed Type 4a Video: XVID, DIVX or any others Audio: MPEG Audio Layer 3 (aka MP3), Vorbis, AC3 or any others - video and audio transcoding needed Type 4b Video: MPEG4 Video (H264), XVID, DIVX or any others Audio: MPEG Audio Layer 3 (aka MP3), Vorbis, AC3 or any others Subtitle: Advanced SubStation Alpha or any others - video and audio transcoding needed while hardsubbing subtitles About the pixel aspect ratio Since version 1.02 I had to introduce an option to specify the pixel aspect ratio in order to retain the correct look of the video. Unfortunately this currently cannot be automated and has to be set by the user. First thing to do is to open once again the basic properties of a file in Media Player Classic as described in the previous section and look closely at the video part. If you see something like "Video: MPEG4 Video (H264) 704x480 (853:480) 23.98fps [Video]" or "Video: MPEG4 Video (H264) 720x480 (853:480) 23.98fps [Video]" or even "Video: MPEG4 Video (H264) 704x400 (711:400) 23.98fps [Video]" it means that there was a custom ratio set by the person who made the video file (for those interested the first resolution is the one at which the file was encoded and the second one, in brackets, is the one that it gets stretched to on playback). You need to make sure to do the same. If there is just one resolution listed it means that nothing was set and you should just choose "1:1" when the option appears. I'll just simply list the most common possibilities and their respective pixel aspect ratios for ease of use. 704x480 (853:480) or 704x480 (16:9) - 40:33 720x480 (853:480) or 720x480 (16:9) - 32:27 704x400 (711:400) or 704x400 (16:9) - 100:99 704x480 (640:480) or 704x480 (4:3) - 10:11 720x480 (640:480) or 720x480 (4:3) - 8:9 For other non-common ones please contact me and I'll try to help you. Getting it all down Before starting the script, make sure to move the file that you would like to convert into the directory where you unpacked the mkv2mp4.bat script and where the bin subdirectory is located. Now run the script by double-clicking on it. Firstly it will ask for the type of file that you would like to convert. You should have already determined that from the previous section. The possible choices are from 1 to 4. A word of warning before I proceed to the next step. Please make sure that the files that you want to convert don't have any spaces in them. Best thing is to just replace them with underscores. Same goes for any other files that you may be using later on. Depending on your choice it will ask for other inputs which I'll describe next; Type 1 1) This one will ask next for the input filename of the file that you would like to convert without the extension. 2) Then it will ask for the output file, without the extension again, which is just the name of the file that it will create using the MP4 container. After that it should just work through all the lines in the script, delete all the intermediate files at the end and place the output into the directory where the script is found. And you're done. Type 2 1) Same as step 1 and 2 from Type 1 Type 3 1) Firstly you need to change one setting in CCCP. Go into its Settings application, click Next and check "Autoload VSFilter" and Apply. 2) You need to create an AviSynth script. Place the MKV file into the directory where you unpacked the mkv2mp4.bat script, and create the script there as well. Here is a basic example of an AviSynth script; Code:
DirectShowSource("C:\path\to\file.mkv") 4) It will ask for the AviSynth script filename, without the extension. 5) Same as step 2 in Type 1 6) Now it will ask whether the video is standard or high definition. This just tells the script to use different encoding settings, since for once you don't really want to kill the encoding speed or playback too much, right? 7) Finally it will ask for the bitrate. Usually go with some value given in the recommendations range. It should give decent results. 8) Now just wait for it to do its job and spit out an MP4 video file. Type 4 1) Same as steps 1-8 in Type 3 --- Spoiler for the old "manual" way (no longer updated):
Constructive feedback is of course welcome. (Hopefully I haven't missed anything important or made some silly mistake, since you could consider this as an intermediate version.)
__________________
Last edited by martino; 2008-12-19 at 12:26. Reason: v1.03 update |
2007-05-17, 13:07 | Link #2 | |
Administrator
Administrator
Join Date: Jan 2001
Location: Netherlands
Age: 44
|
Alternative Guide
This version is a bit easier. However, as the video will be re-encoded (even if the subtitles are already encoded into the video), the result will most likely be lower quality. 1. Required Software - MKVExtractGUI - mkvtoolnix - VSFilter (part of CCCP, so you should have it already) - PS3 Video 9 (similar tools might also work for other systems such as PSP or Wii) - AviSynth (optional - also included in PS3 Video 9!) The first three files are only necessary if the file you are trying to convert MKV files with soft subtitles. 2. Extracting the subtitles If the file has soft subtitles, you need to extract the subtitles first using MKVExtractGUI. Make sure you put MKVExtractGUI in the same folder as mkvtoolnix (C:\Program Files\mkvtoolnix by default) btw. The subtitle file (shown as S_TEXT/ASS for styled subtitles or S_TEXT/UTF8 for plain subtitles) will be put in the same folder as the video file. Note: some MKV files also include fonts. You may need to extract and install the fonts (using the Control Panel) in order for the styled subtitles to look just the way they're supposed to look. 3. Write the AVS (AviSynth) file This is the hard part: writing the AVS file. Actually the hard part is getting the folders and filenames just right (this could be tricky if the file has a complicated filename and is in a folder a few levels deep). Btw, an AVS file is simply a text file with a .AVS file extension. Write a AVS file that looks like this: Quote:
If the MKV file you want to convert does not contain subtitles (in case they're already encoded in the video) leave out line 1 ("LoadPlugin") and line 3 ("TextSub") and keep just line 2 ("DirectShowSource"). Before converting, verify the AVS file works by opening it in MPC (Media Player Classic). If you get a AviSynth error message, you'll need to fix the AVS file. 4. Convert with PS3 Video 9 I'm not going to explain the usage of PS3 Video 9 here, as it's pretty simple. Also you'll need to test for yourself which conversion profile works best for you. But if you have followed the steps above, you should be able to convert the MKV file just like you would any AVI file. If you need a hint: select "Convert", then "Current conversion" tab. Then just click the "Convert video" button and select the AVS file you just created. Optional hint If you go to Start -> Programs -> Combined Community Codec Pack -> Media Splitter Settings and then under the Options tab enable "Autoload VSFilter" (in Compatibility section), you might be able to skip the whole MKVExtractGUI phase! You probably still need to write the AVS file, but you can get away with just the "DirectShowSource" line (and leave out the others). Disclaimer I have neither a PS3 nor a Xbox 360, so I can't test this. But I did succesfully convert various files to PSP format (using PSP Video 9) this way. Last edited by GHDpro; 2007-05-17 at 14:50. |
|
2007-05-17, 19:39 | Link #3 |
King of Hosers
Join Date: Dec 2005
Age: 41
|
Loading VSFilter within DirectShowSource (if you use Autoload VSFilter) might get flipped images and such depending, just be sure to preview before you hit encode.
Also specific note in terms of re-encoding while using the CCCP's ffdshow, you should turn on YV12 ouput in FFDShow Video Decoder Config under Outputs. Less colorspace conversions = more good for you. Next CCCP version will already have this on by default, but currently all past versions have used YUY2. |
2007-05-18, 17:45 | Link #4 |
Junior Member
Join Date: Feb 2006
|
i've figured out a way to do this on the mac, it eats up a bit of disc space however. and it only works for files with one audio track.
doing converts straight from viddyup sometimes resulted in stuttering files so... make sure you have perian 1.0 (beta) installed (http://perian.org/beta.html) and download viddy up (www.splasm.com) the unregistered version works fine, as we are only going to transfer it into a .mov (renaming won't work) from there you can use isquint (www.isquint.org) or visualhub (£££) (http://www.techspansion.com/visualhub/) ... well, personally i just use the apple tv settings & h.264 - high or standard. some files i notice a noticable quality difference, some i don't. just depends on the original encode i guess. - oh, directly converting from mkv using visualhub sometimes works, but this is a surefire way to make sure you get subtitles. |
2007-08-10, 14:25 | Link #5 |
Junior Member
Join Date: Aug 2007
|
Hmm, I have a slight problem. I successfully converted one file to .MP4 and it played fine. However when I was working on my second one I get this problem.
Spoiler for :
Not sure what to do here. I rechecked the steps and redid everything but the same problem occurs. EDIT : Scratch that. I got it to work somehow. I guess I mistyped something. >_>. Last edited by Hinosaki; 2007-08-10 at 15:17. Reason: Figured it out. |
2007-08-11, 21:58 | Link #6 |
from head to heel
Join Date: Jan 2004
Location: Vancouver, Canada
Age: 41
|
Ok, I'm obviously a newbie at this... so, I have question if you guys don't mind me asking.
Do any of the illustrated methods work for videos (.mkv) with multiple sound channels? I would like to convert something which has "AAC 48000Hz 6ch [Audio]." EDIT: Never mind. Figured it out for myself. Thanks for the guides. Last edited by kujoe; 2007-08-13 at 20:26. |
2007-12-01, 14:41 | Link #7 |
Loves stripes.
|
Question/concern~ So like, I'm using the alternate method since it looked more nub-friendly, and for some reason I'm having problems. When I get to the conversion process, it for some reason won't add to my iTunes library, and when I try to open it manually, it will only play audio in Winamp. However, using the exact same method, but using the 30second test option, it works perfectly.... What could be causing this? x_x
|
2007-12-01, 21:40 | Link #9 | |
makes no files now
Join Date: May 2006
|
Quote:
Also as an update I will attempt to write a script for ease of use, after my exams though. However I currently do have a batch script for converting any file that plays in DirectShow to XviD/MP3 in AVI. It's currently being tested... Just a heads up.
__________________
|
|
2007-12-21, 07:08 | Link #10 |
Junior Member
Join Date: Jul 2007
Location: Canada
|
mp4mobile is probably the best choice if you are willing to pay for it
http://www.videomobileconverter.com/mp4Mobile/ |
2008-01-07, 05:55 | Link #11 |
Junior Member
Join Date: Jan 2008
Location: Nottinghamshire, England
Age: 33
|
Metroska (.mkv etc) to common Windows video file types
I'm not sure I want to go into great detail explaining this but, I always managed to convert Metroska file containers to more common video file types like .wmv or MPEG2 using the Combined Community Codec Pack and the full version of TMPGEnc 4.0 Xpress. I'm new to the forum and joined because I found a great bunch of technical support threads through Google. I hope this has helped anybody who was hoping in not having to overheat their heads over the challenge and I'm sure you can pick up TMPGEnc Xpress through torrent searching.
|
2008-01-14, 20:15 | Link #12 |
You could say.....
Join Date: Apr 2007
|
you realise that this product is a retail product. TMPENGC v4.0 is not a free product and any torrented version of it is pirated. It is sold for $110USD
http://forums.animesuki.com/faq.php?...#faq_rules_1_1
__________________
|
2008-01-14, 21:11 | Link #13 |
Translator, Producer
Join Date: Nov 2003
Location: Tokyo, Japan
Age: 44
|
I just noticed this thread... and came to gloat a bit.
Ah, I remember the days back in 2005 when I was ridiculed for switching to h.264 in mp4 in my group (one of, if not the first group to do so)... And now to see people actually requesting their mkvs be converted into mp4s, for exactly the reason I predicted (better hardware playback compatability) makes my day. I love being right.
__________________
|
2008-01-21, 23:38 | Link #14 |
CaramellDansen!!!
Join Date: Apr 2006
|
I have a question about this. Whenever I encode mkv to mp4 files, it will leave me too extract the fansubs and merge them back to the mp4 file. Question #1: Is it possible for a way to merge the Typesetting along with the subtitles into the newly encoded mp4 file? Question #2: If it don't work, then is there like another way for it to see it with typesetting using the fansub group typesetting?
|
2008-01-22, 10:30 | Link #15 |
the cynic
Join Date: Nov 2006
Location: Somewhere between life and death.
Age: 42
|
If you are just converting for your PSP then there's also XviD4PSP, which contrarily to it's name, handles just about any file format. It seems to work OK.
It appears to uses FFdshow, so it your mkv has subtitles, you might want to go to FFdshow video decoder options to turn on subtitles and embedded subtitles. The subtitles will end up hardcoded to the resulting MP4 file.
__________________
|
2008-01-22, 17:51 | Link #17 | ||
makes no files now
Join Date: May 2006
|
MP4 does not support softsubs, ok maybe it does, but no device supports the TTXT format. Plus, you're not gaining anything by converting a softsubbed MKV to a softsubbed MP4, in terms of niceness and compatibility. It's just... pointless.
Quote:
Quote:
__________________
|
||
2008-01-22, 18:42 | Link #18 |
CaramellDansen!!!
Join Date: Apr 2006
|
I wish to see the same typesetting as the fansub groups already provided in the mp4 BUT the mkvmerge doesn't allow you to merge the typesettings and only the subtitles. In other words, I wish to merge the typesettings but I don't know how loll.
|
2008-01-25, 09:46 | Link #19 | |
the cynic
Join Date: Nov 2006
Location: Somewhere between life and death.
Age: 42
|
Quote:
I'm clueless as to what goes on behind the scenes (hence my using of a program with a relative simple GUI). I had to fiddle around quite a bit to get subtitles to appear (hardcoded of course) in the resulting PSP compatible MP4 file. I tried adjusting DirectVobSub's setting, to no valid, then I read something about turning on the subtitles in FFDshow, and that did the trick.
__________________
|
|
2008-01-25, 12:19 | Link #20 |
makes no files now
Join Date: May 2006
|
Typesetting is usually hadsubbed on the video, or softsubbed in the same track as the dialogue because you can't have two softsub tracks playing at the same time. Also, what are you trying to achieve? Softsub an MP4? For what point? It's totally pointless as I posted before...
__________________
|
Tags |
file conversion, wiki candidate |
Thread Tools | |
|
|