Subtitles and dxva | Page 3

Discussion in 'Improvement Suggestions' started by André, April 3, 2008.

  1. sonix1977nl

    sonix1977nl Portal Member

    Joined:
    June 10, 2008
    Messages:
    24
    Likes Received:
    8
    Ratings:
    +8 / 0
    I have written a custom directshow source filter, which outputs an bitmap with alpha channel with the text "Hello world!" rendered in a subtitle kind of way. By connecting the decoder (MPCVideoDec with DXVA enabled) to pin 1 on the VMR9 filter and my custom filter on pin 2, I get that text rendered over the video. By both running with DXVA enabled and disabled and watching CPU usage, I can confirm that my method works in combination with DXVA enabled.

    This could form the basic for a directshow filter that converts a subtitle stream into bitmaps with alpha channel with the subtitles rendered in those. That way we could have DXVA enabled and subtitles. Since it is a directshow filter, it could be used by many different players.


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. damaster

    damaster Portal Pro

    Joined:
    November 23, 2007
    Messages:
    412
    Likes Received:
    35
    Ratings:
    +35 / 0
    Home Country:
    Canada Canada
    Incredibly awesome! I'm willing to test it out if you want. You've got a PM.
     
  4. Johan

    Johan Portal Pro

    Joined:
    April 19, 2006
    Messages:
    443
    Likes Received:
    11
    Ratings:
    +11 / 0
    Home Country:
    Sweden Sweden
    This is extremely good news! I have postponed my purchase of a new graphic card since I have no use of dxva if I can not have subs. My CPU is able to handle 720p files sort of (100% cpu load) but as soon as I add subs it gets out of sync.

    I hope your effort will lead to some great things. Then I finally can get a new graphics card! :)
     
  5. stoked
    • Premium Supporter

    stoked MP Donator

    Joined:
    December 14, 2007
    Messages:
    297
    Likes Received:
    8
    Ratings:
    +8 / 0
    Home Country:
    Canada Canada
    sonix1977nl,

    Sounds great! I assume this would work without EVR on XP?
     
  6. sonix1977nl

    sonix1977nl Portal Member

    Joined:
    June 10, 2008
    Messages:
    24
    Likes Received:
    8
    Ratings:
    +8 / 0
    I have only tested it on Windows XP without EVR, since I currently dislike Vista for my development/gaming PC. ;) But don't get excited to early. It's a promising start. But I have no idea how hard it actually is to interpret the subtitle stream for example. So it probably will take some time, depending on my skills and how much time I can and am willing to put into it. I'll try to upload my sample + source code ASAP so that others can fiddle around with it.
     
  7. Johan

    Johan Portal Pro

    Joined:
    April 19, 2006
    Messages:
    443
    Likes Received:
    11
    Ratings:
    +11 / 0
    Home Country:
    Sweden Sweden
    I guess that you can use the source for interpreting the subs from others? FFDShow and Vobsub is opensource I think(?)

    I am really looking forward for this filter. And I since it is a filter it can be used with all video softwares for PC and not only MP (I assume).
     
  8. sonix1977nl

    sonix1977nl Portal Member

    Joined:
    June 10, 2008
    Messages:
    24
    Likes Received:
    8
    Ratings:
    +8 / 0
    I'll have a look at them later. But I first have to see if I it is possible to get the source filter automatically render at the same resolution as the video file. After that I can actually have a look at the actual subtitles.
     
  9. sonix1977nl

    sonix1977nl Portal Member

    Joined:
    June 10, 2008
    Messages:
    24
    Likes Received:
    8
    Ratings:
    +8 / 0
    Unfortunately, for rendering many subtitle formats correctly, the subtitle renderer (like VobSub) seems to need information about resolution of the video and aspect ratio. These are normally only available from the decoder output, which is probably one of the reasons why VobSub connects on the decoder output pin. So I don't know how viable this approach is. :(
     
  10. tourettes
    • Premium Supporter

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    You could add an interface to the filter that can be called from MP code (as MP knows the video resolution and aspect rate). Also I think the video renderer can be queried for such information (not 100% sure, but highly likely).
     
  11. sonix1977nl

    sonix1977nl Portal Member

    Joined:
    June 10, 2008
    Messages:
    24
    Likes Received:
    8
    Ratings:
    +8 / 0
    As far as I can tell, you can also get that info from the output pin on the splitter. But only one connection is possible from a pin, so maybe I need to make some kind of filter that repeats the input stream from a splitter to multiple output pins. Or have the subtitle filter do that. Somewhat like Vobsub, but with the difference that it is placed between the splitter and the decoder instead of the decoder and the renderer.

    If someone has some info about the things you suggested, I would be happy to hear about it.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!