View Full Version : Matroska and Subtitles...
Dr.Khron
2nd February 2007, 15:55
(mods, this may belong in the Gknot forum, move if you see fit)
Ok, so I'm new to Matroska...
I'm ripping some of my DVDs into MKV files using Gordian Knot. I am aware that there are newer programs designed specifically for MKV, but I know Gknot well and would like to start with sometime familiar.
As far as I can tell, there are two ways to add subs to an MKV file in Gordian Knot: by adding a .SRT file on the "Chapters/subs" page, or by adding the .IDX file on the "Save and Encode" page (where you can run a compressabiltilty test, before adding the job).
The Doom9 guide suggests that the second way is better, becuase it overlays graphics instead of a text stream.
I tried a sample both ways...
The picture stream definintely LOOKS better.
When loading the files into Dub, the text-subs file has four streams: 1 video, 2 audio, and the subtitles. When loading the second file, I see only three streams, with no sub stream!
I'm guessing that the picture method hard codes the sub-pictures into the stream, and that you need to have a filter installed on your system to remove them. Is this correct?
Also, the subs are turned on by default... is there a way to set up the MKV file so that subs are OFF by defualt, and must be turned on?
Thanks for any advice.
Brother John
2nd February 2007, 20:01
I'm guessing that the picture method hard codes the sub-pictures into the stream
Correct. Dynamic Vobsubs are not possible with GK because VDubMod doesn't support those. For "real" Matroska muxing mkvtoolnix is the better choice anyway.
is there a way to set up the MKV file so that subs are OFF by defualt
That's not really a problem of the container. Your player should provide an option to turn subtitles on or off by default.
HeadBangeR77
2nd February 2007, 21:03
Just a tip:
I usually do the same thing, when I encode directly into mkv i.e. I use old good GK. After that, however, I mux the file once again using MKV Toolnix, so that I can add the main title, streams' titles, language settings, and get rid of junk tags and so on. ;)
Dr.Khron
6th February 2007, 17:00
Ah Headbanger, I like your solution. Thank you.
I'm assuming that your process is this:
1. encode the video with the .IDX subtitles in Gknot
2. throw away the muxed MKV file that Gknot produces
3. Create a new MKV file with MKV Toolnix (from the encoded video and previously transcoded audio streams)
Am I missing anything there?
As a final question, once I decide to switch from Gknot, what programs would people recomend that I start with?
-Dr.K
HeadBangeR77
7th February 2007, 01:17
Ah Headbanger, I like your solution. Thank you.
You're welcome. :)
I'm assuming that your process is this:
1. encode the video with the .IDX subtitles in Gknot
2. throw away the muxed MKV file that Gknot produces
3. Create a new MKV file with MKV Toolnix (from the encoded video and previously transcoded audio streams)
1) I don't let GK (in fact it's VdubMod) handle subtitles, nor chapters, I just encode the main film, sometimes with sound, just to check, if the delay was right.
2) Or import it directly into MKV Toolnix, depends on my mood. ;)
3) Yes, plus I import the subs (mostly srt, sometimes idx/sub) and the chapter file (there's also a compact chapter editor in MKV Toolnix).
Am I missing anything there?
Don't think so - you could do it the way you had described earlier, or the way I described above. There should be no difference.
As a final question, once I decide to switch from Gknot, what programs would people recomend that I start with?
Probably more than 50% of folks here will point to MeGUI.
I really don't know, since I'm using GK as bitrate calculator, resizing helper and sort of frontend. Some things I do separatelly, like transcoding with BeLight, creating chapters etc. As long as it's suitable for my tasks, I will carry on using it (guess I'm getting old & conservative :D ;)).
cheers,
HDBR77
Dr.Khron
11th February 2007, 18:03
As long as it's suitable for my tasks, I will carry on using it (guess I'm getting old & conservative ).
Yeah, I hear you, I'm the same way...
Learning GKnot was a hurculean effort for me, since I knew almost nothing about digital video when I started fooling around with it. I'd love to stick with it, but it just hasn't gotten the development that some other packages have.
That said, I'm not sizing my encode, since I'm trying to make archival quality backups for hard-disk storage and use (I MUCH prefer to watch my TV episodes off a hard drive, so you can have a whole season in one directory, instead of spread across multiple disks).
I've been using Divx at AVG BR of about 1800-2000. I began using DIVX under the assumption that I might buy a hardware Divx player someday. Since no hardware player can read MKVs, that frees me up a bit, so I may start experimenting with new codecs.
What video codec do you use to put inside your MKVs?
har-vas
19th February 2007, 17:46
Hi. I am following exactly the same steps as HeadBangeR77 for my encodes. I use IDX (vobsub) subtitles but not hardcoded on the film, just inside the container, so that I can enable/disable them at will. Then for playback I use Media Player Classic (MPC), because I want to be able to change the subtitles position and move them under the video (in the black bar). Finally, if I want to enlarge them, not permanently, just for a single playback (because eg I am sitting in my couch, 3 meters away of the monitor), I disable the subtitles from MPC and I enable the subtitles filter from ffdshow. The latter has the ability (supply a slider in its settings) to enlarge vobsub subtitles, while MPC hasn't. I consider it as the only solution for subtitle's enlargement when the IDX file is inside the container and can't be accessed/edited with VobSub. By having all this flexibility, I set aside SRT subtitles, since they require a lot of work (especially the correction of OCR errors) and don't have any big advantage over IDX/SUB. Be aware that the only tool which can mux (not hardcode) IDX subtitles in a Matroska file is MKVtoolnix (AVI-Mux GUI and VirtualDubMod can handle only text-based subtitles).
As for the codec, I personally use x264 VfW which is much better than DivX, but this is something you could more easily understand in low bitrates (below 1000 kbps). In 2000 kbps I think that DivX is excellent too (or at least good enough). Be aware that the development of x264 VfW has officially stopped since rev580 (the latest official VfW build I know is 573). The greatest GordianKnot uses VfW only of course, not the command-line version which you will find in www.x264.nl. There are only two places to find x264 VfW builds at this time:
http://www.deaththesheep.uni.cc
http://kurtnoise.free.fr/index.php?dir=x264vfw
The first one has at this time rev600, while the second one gives rev621 these days. But the rev621 from kurtnoise13 misses support for multithreading, so if you have a HyperThreaded P4 or a dual-core CPU (like I do), go for the rev600 from DeathTheSheep. You will encode a lot faster if you enable 2 threads in the codec's configuration panel. Whatever version you select, don't forget to read the excellent x264 VfW guide from deaththesheep (DTS). You will learn how to tweak the encoder to meet your needs (eg achieve maximum quality in reasonable encoding time). Also you should read in the DTS forum the list with the advantages of x264 VfW over x264 command-line. For any help and support regarding x264 VfW, I propose you to ask there, not here (because it's a very picky subject).
As for the development of GordianKnot, unfortunately it's dead (but very useful and fully working yet, at least if we talk about x264). DivX 6 is not supported, for example. You can read here the thread I recently opened, asking this question: http://forum.doom9.org/showthread.php?p=896307
I hope my answer was useful.
PS: If you start dealing with x264 VfW (i.e. encode with GordianKnot and then muxing with MKVtoolnix), don't forget that the latest version of MKVtoolnix which supports storing AVC content in VfW mode is 1.8.1 (by adding the relative development hack from Muxing menu). Since version 2.0, the AVC output of MKVtoolnix is always in native mode. I have asked about it, but no answer yet...
http://forum.doom9.org/showthread.php?t=120648&page=7
Dr.Khron
19th February 2007, 22:20
Wow, thorough answer, thanks for the feedback.
I've been using divx6.0 with GKnot, I didn't realize that there was a problem.
HeadBangeR77
20th February 2007, 01:27
@ har-vas:
Hello again. ;) I see none has answered you in your matroska-tags-thread... I don't think many people use them so often and in the way you do, yet no software support for such a things is a surprise for me. To the matter:
1) Be blessed for describing the way you use idx/sub! :D One of the main drawback of using them was the fact I couldn't change their size, 'cause I didn't know how to do it. Gee, I'm rather familiar with ffdshow, yet I've been using srt subtitles for such a long time that I've forgotten how to properly handle idx. Still, I've got some DVDs with e.g. English subtitles for hearing impaired only, then I have to edit them to get rid of all unwanted parts.
2) As to codecs:
a) I'm still using x264 VfW version (switched recently from DTS rev.600 to Kurtnoise's rev.621, since I've got a single core system), and they seem to work fine both with GK/VDubMod and VirtualDub 1.7.0. Lemming's GUI for CLI/non-VfW versions is an alternative solution, if you don't want to use MeGUI for some reasons (as I don't for instance ;)).
http://forum.doom9.org/showthread.php?t=112770
b) Are you 100% sure DivX 6.X isn't compatible with GK/VDubMod? I used to encode with 6.4 and had no problems at all, yet I must state it wasn't the wisest of purchases in my life, since I still prefer XviD much more (for instance because of huge choice of custom quantization matrices), and it's free. ;) It's 6.5 DivX version from which on GK is incapable to cooperate, AFAIK.
c) MKVToolnix: I don't know why the option has been removed (VfW x264 storage) from the last release. I keep both 1.8.1 with the latest patches (before 2.0.0 was released) and 2.0.0 on my hdd. Does it really matter, as long as you don't do any editing? Editing and proper information about video stream is one of the few drawbacks of AVC in general. :(
@ Dr. Khorn:
I wanted to answer you some time ago, but my browser crashed then, I had many tabs opened at the time, and forgot it completely after restart. Sorry. Hope you can benefit from our little codecs' introduction /discussion. ;)
cheers,
HDBR77
har-vas
20th February 2007, 23:22
Hello again. I have to answer to some questions and clarify 2-3 other things. I am glad because I see that my previous answer was useful. In general, I believe that you should write in a forum only when you have to say something, to write carefully and responsibly, to give feedback when you ask for help, to write in an understandable way (not in a hurry), etc.
1. As for MKVtoolnix, I want to say that today Mosu answered in my questions and (among others) said that is going to re-add the "allow_avc_in_vfw" hack. That's great! Look at the last link in my previous post to read his answer. Until then, I am also using v1.8.1.
2. As for the x264 rev621 (just as additional information), if you enable 2 threads in the configuration panel, you are going to receive a warning message at the start of the process: "not compiled with pthread support!" (then the encoding will normally start, but with a single thread). I have asked Kurtnoise13 about it:
"why an older revision has better support for dual-core CPUs than a newer?"
- because multithread support in x264 has changed since rev 600.
"Do you plan to release a version with multithreading support?"
- not yet coz I don't have time & multi-core proc.
So I have to wait for a new revision by DTS, I suppose...
3. I agree with HeadBangeR77: For someone who knows the VfW interface, yes, Lemming's GUI is the first step to the pass to the x264 native mode. After a period of encodings with it, it would be a good idea in my opinion to try something more complete and advanced, like AutoMKV. Anyway, at the moment my personal encoding needs are being sated perfectly by VfW. Finally, for someone who has both VfW and native AVC videos in his system, I think that a video analyzing tool like MediaInfo or VideoInspector is really necessary, so that he can distinguish what is what.
4. As for the vobsub's enlargement capability of ffdshow, I have to add that if you want the subtitles to be displayed below the video (i.e. in the black bar), you should enable the Letterbox checkbox and set the ratio of your monitor (then I think is mandatory to restart the player for this setting to take effect). Take a look at my settings-scrrenshots and also have a look in my two examples. It's easy to understand what this "letterbox" setting does and how ffdshow achieves that result (subtitles below image). Notice that the actual image is not being stretched, while the subtitles seem to be a little stretched. Also, take into account that the vertical position of subtitles in the ffdshow settings is always the same (91). Finally, I have noticed that if the vertical position is too low, then ffdshow doesn't display anything. Example: I had the vertical position to 93 for an x film and everything was fine. Then I opened another y film and no subtitles! I changed the position to 92 and still nothing, then I lower it to 91 and the subtitles suddenly appeared (the effects are in real-time, so no re-open is necessary). So I think that the best for someone who wants the subtitles as lower as possible, is to check the vertical position value separately for each video.
Subtitles settings: http://img300.imageshack.us/img300/8645/shot03rr3.jpg
Subtitles-->Vobsub settings: http://img403.imageshack.us/img403/4817/shot04la8.jpg
Vertical position 91 but no letterbox: http://img230.imageshack.us/img230/4522/firstnonletterboxtl8.jpg
Vertical position 91 with letterbox 4:3: http://img230.imageshack.us/img230/2800/firstletterboxnv9.jpg
Vertical position 91 but no letterbox: http://img403.imageshack.us/img403/4916/secondnonletterboxvf2.jpg
Vertical position 91 with letterbox 4:3: http://img230.imageshack.us/img230/486/secondletterboxfe7.jpg
5. As for the various media players, I want to add that many times I also use TCMP v4.11 instead of MPC, mainly for two reasons: i) Because it has a built-in "Colors Control" function (I am mostly interested in Brightness slider). This is very useful when you are using a decoder filter that doesn't provide by itself picture properties, like for example CoreAVC or WMV DMO. MPC has no such "color controls", except from its built-in MPEG-2 filter i.e. only in DVD you can increase brightness. But if you open a dark x264 or WMV3 video in MPC, where the relative filters don't have a brightness slider, you are going to watch a dark movie. The best of course is to provide the filter by itself color controls, so that you can have the same colors, brightness level etc in whatever (DirectShow-based) player you select to watch the movie with. I have made this question in CoreAVC thread, but BetaBoy didn't even answer http://forum.doom9.org/showthread.php?t=104277&page=129. ii) Because TCMP can co-operate with DSP plugins of Winamp (eg DFX, Enhancer etc). I am using Enhancer and the sound of the movie is much-much better than for example in MPC, where there are no DSP effects.
6. As for GordianKnot and DivX 6, maybe I am wrong, sorry. I remember though that I had tried to encode 2-3 times with DivX 6.0 (that period it was great news a new DivX version after over a year) and I had problems with the bitrate calculation and hence the filesizes. I don't even remember if the final size of the .avi was much smaller or much bigger than the one specified in GordianKnot. From that point, I never re-tried to encode with GordianKnot and DivX 6. Maybe this problem was fixed in the later DivX versions or maybe the problem was with my GordianKnot, what can I say? If you can encode normally with DivX 6.4, then great!
7. In the end, because HeadBangeR77 said that "Editing and proper information about video stream is one of the few drawbacks of AVC in general", I would like to comment this: As for editing, if we talk about VfW AVC stream (either stored in matroska container or in avi) there is absolutely no problem (VirtualDubMod and ffdshow-->"VFW configuration" are here). But if we talk about native AVC streams, yes, there is an editing problem yet. As for information, I am using track names in mmg to add some extra information about tracks in my Matroska files (and of course I am using "file title" to add the movie's title and year). Have a look at the following screenshots taken from the excellent VLC (obviously, I had to temporarily disable the "Overlay video output" option, otherwise we would see a black box, instead of the current frame):
Here is the codec and (average) bitrate information (taken from the accurate results of the bitrate analyzer by Matroska Shell Extension) of the video stream:
http://img148.imageshack.us/img148/8563/videotrackdj3.jpg
Here is the application and (average) bitrate information of the audio stream (taken from the same bitrate analyzer). You can also see at the bottom, the title of the movie and the year:
http://img230.imageshack.us/img230/2225/audiotrackja7.jpg
Here is the chapter's information. Note that I am using two languages per chapter's title, a Greek title and the same title translated in English (with the corresponding chapter language codes). Strangely, the TCMP prefers to detect only the english names, while MPC reports only the greek names! Only VLC can detect correctly both versions:
http://img403.imageshack.us/img403/9435/chapterspv0.jpg
Also, with the help of mkvmerge GUI (mmg), I am attaching the cover of the movie in the final .mkv and in the description of it, I am writing (pasting) the summary of the movie in Greek. Take into account that the attachment's description (hence for me, the movie's summary) can be displayed by MediaInfo. In that way I have all the information I need, without using any tags (which are almost useless anyway, since there is no program to display their info correctly). Other things like fps, codecs, duration, resolution etc are already easily accessible via MediaInfo.
Here is the cover: http://img230.imageshack.us/img230/9259/coverkm0.jpg
Here is the summary: http://img403.imageshack.us/img403/3039/summaryqm9.jpg
That's all by now... Now I am going to continue the translation of the DTS x264 VfW guide in Greek..
foxyshadis
21st February 2007, 01:40
As for editing, since there are no mkv tools I do all my encoding/editing/etc to mp4 and work in avidemux for most of those needs, and mux to mkv in the end. Although not as nice as vdub, it's a lot more compatible. It's not too hard to pop what's in an mkv into mp4 and back. I can understand how that isn't a workable solution for everyone.
Trouble is, I use vorbis audio so special effort has to be taken to edit it as well, whereas if AAC was used I could work on it directly with the mp4. One of these days I'll try to get an mp4-compatible lossless to work.
har-vas
22nd February 2007, 19:05
@foxyshadis: If I understood correctly, you are encoding with eg Lemming's GUI in native x264 stream, by using .mp4 container instead of .mkv. Then you open avidemux and you edit (i.e. cut or delete parts) this mp4 file. Finally, you open MKVtoolnix and you convert this edited mp4 into mkv. Am I correct?
If yes, this is interesting. I didn't know that there was a way to edit native AVC streams with a tool similar to VDubMod. I didn't even know about Avidemux, because I am working with matroska files all the time. I have never used .mp4 or .aac (I always prefer the open standards). Also you say that if you use .aac audio stream, then you can use avidemux to edit simultaneously video and audio, like we do in VDubMod, am I correct? If yes, I will give it a try. But before that, I would like to hear your opinion about this editing tool, avidemux. Is it effective and reliable like VDubMod? Thanks.
One of these days I'll try to get an mp4-compatible lossless to work.I don't undestand what do you mean by that. Could you please explain?
foxyshadis
22nd February 2007, 21:15
It's pretty reliable, and it's been in pretty major development for some time now. The functionality is quite broad, and the GUI is not great when coming from virtualdub, but there's work going on to address some of that for the next release.
As for lossless audio in mp4, there's Apple Lossless (ALAC) and ALS, but I have yet to find out if either are compatible with avidemux yet. Alternately, you could use the original mp3/ac3 and only convert it to vorbis after editing's done. If you convert your audio tracks to aac you'll never have that problem, since they work great in mp4 in avidemux.
har-vas
26th February 2007, 07:54
Hello foxyshadis. I have installed the latest Avidemux 2.3.0 to see if I can really edit an .mp4 file with native AVC video stream and AAC audio. I used Lemming's GUI to create such a file, which is perfectly playable in my system (Haali splitter+ffdshow). I don't why, but when I open this file in Avidemux, the program crashes immediately. I have tried many times and I have also noticed that this is happening not only with that particular file, but with .avi files also. Have you ever encountered that issue? Have you any idea about it? I would like to give that program a try. Thanks.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.