Subtitles and dxva (1 Viewer)

ronzelver

MP Donator
  • Premium Supporter
  • March 13, 2008
    97
    5
    Sittard
    Netherlands Netherlands
    Country flag
    Thanks tourettes for the information.

    When the output pin from my test filter is connected to the input pin of another filter I do the following:
    - Get the filter of the input pin I am connecting to.
    - Try to get the IBasicVideo interface from the filter. If it does not support that interface I fail.
    - Query the video width and height from IBasicVideo.
    - Use that width and height to play the whole GetMediaType, CheckMediaType, etc. game.

    So now I have my test filter indeed rendering at the same resolution as the video itself.

    My test filter is a source filter that creates an alpha bitmap with the background some transparent blue and some text that changes over time (long live the Lorem Ipsum generators on the internet for creating some nonsense text ;)). Because the video is still showing, but with a blue transparent window over it with some non-transparent text, I know the thing is working. Checking the CPU usage between DXVA enabled and disabled I can also verify that DXVA works.
    I would really like this feature and it seems that you are already on the right track to get this done :)
    Many, many :D in advance!!!
     

    MrOrsh

    Portal Member
    November 3, 2008
    45
    0
    Has there been any progress on this? I´m currently being rather frustrated that I cannot watch my MKV:s with subtitles.
    I would love it if someone did this. Would help if I could, unfortainly I don´t know much about codning :(
     

    Klapperman

    MP Donator
  • Premium Supporter
  • May 25, 2008
    3
    0
    Netherlands Netherlands
    Has there been any progress on this? I´m currently being rather frustrated that I cannot watch my MKV:s with subtitles.
    I would love it if someone did this. Would help if I could, unfortainly I don´t know much about codning :(
    Yup, I'm also curious if any progress has been made.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Thanks tourettes for the information.

    When the output pin from my test filter is connected to the input pin of another filter I do the following:
    - Get the filter of the input pin I am connecting to.
    - Try to get the IBasicVideo interface from the filter. If it does not support that interface I fail.
    - Query the video width and height from IBasicVideo.
    - Use that width and height to play the whole GetMediaType, CheckMediaType, etc. game.

    So now I have my test filter indeed rendering at the same resolution as the video itself.

    My test filter is a source filter that creates an alpha bitmap with the background some transparent blue and some text that changes over time (long live the Lorem Ipsum generators on the internet for creating some nonsense text ;)). Because the video is still showing, but with a blue transparent window over it with some non-transparent text, I know the thing is working. Checking the CPU usage between DXVA enabled and disabled I can also verify that DXVA works.
    Any progress on this area? I think it there is a small shortcut that you could take

    SourceForge.net Repository - [mpc-hc] Index of /trunk/src/filters/transform/vsfilter

    Just modify that filter so that its not using the first input pin (video stream) to anything and add a separate output pin that would be used to send the alpha blend subtitle picture to the VMR9/EVR input pin.

    That way the workload is much smaller, as all the subtitle decoding etc. are already handled by the vsfilter (no need for testing and implementing...).
     

    magnetism

    Portal Member
    October 3, 2007
    15
    0
    Actually,I tried something different. I quickly setup a source filter, using the microsoft excamples to output a transparent image and connected that to DirectVobSub. So you'd have

    SourceFilter -> VobSub -> VMRMixer
    Haali->Video Decoder -> VMRMixer

    That way, dxva keeps working. I Had to hack VSFilter somewhat to make it deal with transparent blitting etc. But that all seems to work now. The only problem is that the subtitles aren't in sync.
    That, and of course you'd have to setup the sourcefilter somehow to output the correct image size and framerates I guess. Then you'd have to rewrite the MP bits that deal with subtitle filters and make sure VMR works etc etc.
    I'll maybe spend some more time on this later, although to be honest my HTPC has been able to play anything I've thrown at it without dxva so the priority isn't great..

    Anyway, just thought I'd throw the idea out there.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Actually,I tried something different. I quickly setup a source filter, using the microsoft excamples to output a transparent image and connected that to DirectVobSub. So you'd have

    SourceFilter -> VobSub -> VMRMixer
    Haali->Video Decoder -> VMRMixer

    That way, dxva keeps working. I Had to hack VSFilter somewhat to make it deal with transparent blitting etc. But that all seems to work now. The only problem is that the subtitles aren't in sync.
    That, and of course you'd have to setup the sourcefilter somehow to output the correct image size and framerates I guess. Then you'd have to rewrite the MP bits that deal with subtitle filters and make sure VMR works etc etc.
    I'll maybe spend some more time on this later, although to be honest my HTPC has been able to play anything I've thrown at it without dxva so the priority isn't great..

    Anyway, just thought I'd throw the idea out there.
    With VMR9 and EVR you aren't able to use normal alpha channel that the video renderer has, so the idea is not going to work :)
     

    magnetism

    Portal Member
    October 3, 2007
    15
    0
    With VMR9 and EVR you aren't able to use normal alpha channel that the video renderer has, so the idea is not going to work :)
    ? I'm not sure what you mean by that? I tried it in graphedit and the alpha thing did work, blending the subtitles over the movie.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    With VMR9 and EVR you aren't able to use normal alpha channel that the video renderer has, so the idea is not going to work :)
    ? I'm not sure what you mean by that? I tried it in graphedit and the alpha thing did work, blending the subtitles over the movie.
    But did you try it with EVR or VMR9 (with YUV mixing mode enabled, not sure if this can be enabled in GraphEdit) as video renderers?
     

    magnetism

    Portal Member
    October 3, 2007
    15
    0
    With VMR9 and EVR you aren't able to use normal alpha channel that the video renderer has, so the idea is not going to work :)
    ? I'm not sure what you mean by that? I tried it in graphedit and the alpha thing did work, blending the subtitles over the movie.
    But did you try it with EVR or VMR9 (with YUV mixing mode enabled, not sure if this can be enabled in GraphEdit) as video renderers?
    I used the Video Mixing Renderer 9 to test this. Needed the mixing renderer to support input from multiple pins, one movie and one subtitles. That did work. To be honest I've not checked the complete graph pins to check output though. I do know the movie was YUV, I double checked the output of the VobSub filter and it's mediatype was ARGB32.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    Top Bottom