View Full Version : Subtitles from mkv doesn't appear with DirectShowSource
djidjo
10th August 2008, 10:21
Hi folks,
I have MKVs video files I want to convert to AVI with hard subs. When I play the MKV with MPC, I have nice colored subs with its own police, very nice. In the bottom right corner of my screen, I can see that Haali Media Splitter, DirectVobSub and FFDShow Video Decoder are used.
So I made a simple AviSynth script with DirectShowSource, but subtitles won't show ! When I open the script with VDub, I can see Haali and FFDShow icons show up, then the green arrow from DirectVobSub ONLY A FEW SECONDS, then it disappears and another Haali icon shows up. So I have 2 haali icons and no subtitles.
Yes, I demuxed the subs with VDubMod and tried to remux it with TextSub(), both in AviSynth script or in VirtualDub itself but then I get trash on the screen because the filter doesn't understand all color and position instructions.
So, is there a way to activate DirectVobSub in the AVISynth script using DirectShowSource ? Or any other idea ?
Thanks in advance,
Djidjo
IanB
10th August 2008, 11:57
You can try manually building a .GRF Direct Show graph with Graphedit. But you are probably going to find that DirectVobSub wants to connect directly to the renderer, which of course you need to omit, because DSS provides that and joins it with your open pin.
You are probably going to have to reprocess your subs into a format that TextSub() or VobSub() can understand.
sneaker_ger
10th August 2008, 12:06
1.) Copy VSFilter (http://www.zshare.net/download/16759901141ff297/) to c:\windows\system32
2.) start->execute "regsvr32 VSFilter.dll"
3.) Start->programs->Haali Media Splitter->Haali Media Splitter Settings->Compatibility->"Autoload VSFilter"=yes
4.) Enter "rundll32 vsfilter.dll,DirectVobSub" and make it sure that is says "Load when needed" in the general settings
/edit: didn't read your post properly, but try it anyway
djidjo
10th August 2008, 13:38
Thanks both of you for your quick replies. I found a workaround : I demux the subs from the mkv with mkvextract and I get a .ass :rolleyes: file instead of a .srt and that .ass file loads perfectly (police, colors, position and all) with textsub 2.23 in VDub.
I'll still try your solution sneaker_ger, thanks.
Djidjo
djidjo
10th August 2008, 13:44
I just did 3) from your solution and it works perfectly ! Thanks, it's much quicker.
bur
2nd November 2011, 23:34
I know this is an old thread but I couldn't find a solution anywhere.
I have an MKV file with x264 video, ogg audio and ASS soft subs. I want to convert it to hardsubs so that I can watch it on my Android.
First I tried Avisynth with x264:
DirectShowSource("video.mkv")
This doesn't display the subtitles, just like it was described in this thread. So I tried the solution given. VSFilter does autoload now (the tray icon is there) but still no subs are displayed.
Any idea why this happens while the other poster seems to be successfully using it?
Then I tried extracting the subs and using
DirectShowSource("video.mkv")
TextSub("subs.ass")
That displayed the subs but caused all styles to be lost, also there was a delay between subtitles and video. The delay has probably something to do with MKV and could easily be fixed, but still the stylization is gone.
So far the only working method I discovered is opening the AVS file with VDMod and then adding the extracted subs using VSFilter. But AVS would be the more comfortable solution as I'd be more flexible with the encoding.
Is there no way to tell AVS that it should open the file exactly as a DirectShow Player like MPC does? That would solve both the delay and the stylized subs problem in one go.
sneaker_ger
5th November 2011, 19:56
I'll suggest you a completely different solution: HandBrake (http://handbrake.fr/) (use a nightly if you need Hi10p input support). It can read ASS-in-MKV and convert to hard-subbed mp4, while retaining the styles. It can also handle VFR (possibly your reason for losing a/v sync in during AviSynth attempts), choose "same as source" to keep VFR or select a constant framrate of e.g. 23.976 fps. Add the subtitle under the subtitle tab and select "burned-in".
bur
6th November 2011, 18:04
Thanks, but when I tried again now it suddenly worked. This is the setup I'm using now:
Haali with Autoload VSFilter and TextSub("subs.ass") in the AVS file.
Without autoloading VSFilter the styles are gone and without TextSub there are no subs at all.
possibly your reason for losing a/v sync in during AviSynth attemptsThe framerate is probably constant (at least MediaInfo doesn't say anything else), but x264 displayed a warning about ogg audio and that it might cause problems with the timestamp. I added audio=false to DirectShowSource and that got rid of the out-of-sync audio/subs.
So now everything is working but at the expense of having to use Haali/VSFilter. I'd rather use LAV because VSFilter litters the tray with icons as there seems to be a bug in connection with Vista/7. BTW, any chance that will ever get fixed?
sneaker_ger
6th November 2011, 18:17
Without autoloading VSFilter the styles are gone and without TextSub there are no subs at all.
TextSub() only looks in the Windows font directory for fonts, loading a separate DirectShow vsfilter (like in MPC-HC) will make the fonts available globally.
The framerate is probably constant (at least MediaInfo doesn't say anything else), but x264 displayed a warning about ogg audio and that it might cause problems with the timestamp.
MediaInfo can't be trusted, but if the A/V sync is okay when using simple DirectShowSource and TextSub (without other parameters than the source file names), it is indeed constant.
You might want to try AssRender (http://forum.doom9.org/showthread.php?t=148926), which is a TestSub() replacement. It can also load fonts in the current directory, not just the system fonts. (But you have to extract them from the mkv)
For video I'd rather recommend ffmpegsource (http://code.google.com/p/ffmpegsource/) instead of DirectShowSource.
bur
8th November 2011, 23:28
AssRender sounds interesting, but it only works with RGB32 input and the videos are YV12 or something similar.
It can also load fonts in the current directory, not just the system fonts. (But you have to extract them from the mkv)The nice thing about forcing VSFilter to autoload is that I don't need to extract the fonts from the video. I don't really understand why that is, but it seems that once VSFilter got loaded (along with DirectShowSource) it provides the fonts within the mkv to TextSub(). I still think that's strange, but I get the proper fonts without extracting and they're not installed either.
OT: VSFilter litters the tray with icons as there seems to be a bug in connection with Vista/7. BTW, any chance that will ever get fixed?
If by chance anyone ever reads this and like me was looking for a solution for months or years... Try the MPC-HC standalone filter (http://www.xvidvideo.ru/component/docman/doc_details/7574-standalonefilters-1533757x86-be-mod.html). A new vsfilter.dll is included that fixes this problem. Yay.
sneaker_ger
8th November 2011, 23:59
AssRender sounds interesting, but it only works with RGB32 input and the videos are YV12 or something similar.
That problem has long been solved, TheFluff's start post is not up to date, as lachs0r has since picked up the project.
The nice thing about forcing VSFilter to autoload is that I don't need to extract the fonts from the video. I don't really understand why that is, but it seems that once VSFilter got loaded (along with DirectShowSource) it provides the fonts within the mkv to TextSub(). I still think that's strange, but I get the proper fonts without extracting and they're not installed either.
Yep. Just opening the mkv with MPC-HC and its internal subtitle renderer also works. Fonts are made available to all vsfilter instances, then.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.