Log in

View Full Version : External subtitles and DXVA


pankov
4th September 2005, 14:08
I've been strugling to get a smooth playback of some 1080i contents and finally I found the reason. When I have external subtitles (.sub files) the NVidia decoder (and every other I've tested) goes into Software mode. I understand that this is how things are designed to work because DirectVobSub (VSFilter.dll) / FFDShow (ffdshow.ax) needs the fully decoded stream and nothing is left for the videocard.
Having found this an idea came to my mind. Isn't it possible to send the video stream not fully decoded to one of the VMR9 input pins and the subtitles to the other. In this case we will have both DXVA and subtitles.
After some time of testing I can now confirm that connecting video streams to the different inputs of the VMR9 doesn't turn off the DXVA.
So the only problem is how to pass the subtitles to another pin. How to mix the video streams without disturbing the quality of the main video?
I tried the alpha blending offered by the VMR9 but the results are not nice. I used Avisynth and VSFilter to create an blank (black or monocolor) stream with subtitles.
So the big questions are:
Can a "transparent" color be used for the background of the subtitles? Is there such a thing at all?
Can someone of the more advanced VMR users / developers explain how things work. Can we mix streams with VMR9 and not have a washed out or blackened pickture? Can we have a stream with opaque subtitles which is with the shape of the subtitles and not rectangular??? I know I'm shooting in the dark but I think this is the right direction.

will it be possible to change the DirectVobSub/FFDShow filter so it can accept only a subtitle file and not need a video stream?

I hope that I was clear enough, but if I'm wrong I'll try to explain it better because this is important for me and I want to understand how things work in general.

I suppose that this will be a major change for the DirectVobSub/FFDShow but I think it is worth it.

unmei
4th September 2005, 16:24
IIRC VMR9 accepts only a color key, that is you define a color to represent transparent, not having a true alpha (transparency) channel these subtitles will look even worse than DVD subtitles. See GIF vs PNG transparency for a comparision (keep in mind that the video has changing BG color therefore you cannot chet with the GIF blending into the BG..).
But i'm in no way a direct show expert, it is well possible i simply did not find the VMR9's method to do proper alpha blending (and of DXVA i have no idea at all).

pankov
21st September 2005, 13:03
OK
My idea might have not be the best but I can't think of something else.
Can someone of the more advanced users/programmers offer a solution for using external subtitles and not loosing the DirectX Video Acceleration? I suppose this will become a greater problem in the near future when more and more HDTV captures will appear.

Btw
Does anybody know how I can contact either the VSFilter (VobSub) developer Gabest or the FFDShow developers?

movax
21st September 2005, 13:43
Starting at their project pages would be a good idea...
But the point of VobSub files is to be pre-rendered subtitles straight from the DVD: they aren't CPU hogging or whatnot, only problem I've had with them (even HD AVC) is that seeking often disrupts the subs.

pankov
21st September 2005, 13:48
well,
can you give me a hint to what are the project pages? you mean the ones at sourceforge?

Now about the VSFilter. it supports both DVD (pre-rendered) and external text subtitles. I agree that neither of them hog the CPU. The problem is that VSFilter and ffdshow need the whole video stream decoded before they can add the subtitles to it. And this is the thing that hogs the CPU. This way none of the DXVA capable decoders (NVidia for example) can't rely on the video card to assist the decoding and this way free up the CPU.

movax
21st September 2005, 14:01
Um, iirc most of the current MPEG-4 hardware accelerated stuff is borked/vaporware-ish. But ffdshow is on sourceforge (http://ffdshow.sourceforge.net) as is VSfilter (http://guliverkli.sourceforge.net). And, VMR9 is awesome in theory, but thanks to the current video drivers, most agree that Overlay Mixer still has teh best quality.

pankov
21st September 2005, 14:16
I agree with you about the MPEG-4 hardware acceleration but what I ment was MPEG2 as this is the format most of the HDTV operators use. Also this applies to a the little number of WMV-HD titles too.
I've mailed the authors on these sites just before I wrote here earlier today and now I'm waiting for replies. I just wanted to bring greater attention to this issue.

movax
21st September 2005, 14:19
Hehe, I remember my old Zoran card that my P2-400 needed to accelerate DVD video. Maybe better support will eventually appear in drivers once they figure out people actually want to watch the HD streams on their computer.

pankov
22nd February 2006, 13:15
I'm bringing up this old thread because this problem is still bugging me and I suppose every non native Englishman that watches HDTV.
The need for subtitles is pretty big (not personally for me but for other people in my family).
I have a couple of new quesitons:
1. How does DVD subtitles get shown when using MPEG2 decoder and VMR?
Are there 2 separate connections to the Renderer? What's the purpose of the Subpicture Input pin in most MPEG2 decoders (NVIDIA in particular)? Can it be used to render subtitles? Is there a DirectShow filter that can convert on the fly text subtitles (.sub/.srt/.txt) back in the format that the MPEG2 decoder can accept?
2. What for is the "In Text" input pin on the FFDShow MPEG-4 Video Decoder filter? Can it be used to render text subtitles?