Tech Off Thread

15 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Superimpose text on top of Windows Media Player

Back to Forum: Tech Off
  • User profile image
    Cannot​Resolve​Symbol

    Is it possible to superimpose text on top of a running Windows Media Player control (or another movie-playing control) using Windows Forms on .net 2.0?  Here is what happens if you use a transparent label:

  • User profile image
    raptor3676

    That is not going to work as you expect  as the WMP is using "Video Overlay" to send the video feed to your screen.  That means that the video is overlaid on the VGA signal sended to your screen so your screen buffer is never aware of the video going on there(*), hence adequate "composition" is never going to happend as you might think.

    Try first not to use video overlay and then we really help you out.  BTW you can find the check box controlling this, in the Options dialog box of WMP.

    Hope this is helpful,
    Raptor

    (*) That's the reason the video is not captured by the PrintScreen command.

  • User profile image
    Cannot​Resolve​Symbol

    I know about video overlay, I already tried it:


    Image Hosted by ImageShack.us

    If I could draw to the WMP video area somehow, that would work too.  It ultimately will be full screen, displayed to a second monitor.  (I have seen this done before, in a program called MediaShout which does more or less the same thing I am ultimately going to be doing.)

  • User profile image
    AndyC

    Nope. If your want to do that you need DirectShow. It's not officially supported from .NET but you can make it work either by importing quartz.dll or using the DirectShow.NET project on Sourceforge.

  • User profile image
    Cannot​Resolve​Symbol

    Maybe it would be better to use DirectX or something for this?

  • User profile image
    Cannot​Resolve​Symbol

    DirectShow isn't even in the SDK anymore...  There is a managed class to play video, but I don't think it will be able to do any drawing, so I need to take another route.

  • User profile image
    AndyC

    DirectShow is no longer in the DirectX SDK, it's in the Platform SDK. It's still the right way to do it.Tongue Out

  • User profile image
    Cannot​Resolve​Symbol

    DirectShow.net looks like what I need--  I'm working in C# Express.  Thanks!

    p.s.  I was quite suprised by the 686 kb download--  sourceforge said it was 686 MB Tongue Out

  • User profile image
    Cannot​Resolve​Symbol

    Intriguing...  DirectShow doesn't use overlaying...  (one of the demos:


    Image Hosted by ImageShack.us

  • User profile image
    AndyC

    CannotResolveSymbol wrote:
    Intriguing...  DirectShow doesn't use overlaying... 


    Nope, for several reasons:

    1) Graphics cards are first enough at blitting to make overlays largely unnecessary.

    2) Not using overlays allows you to do cooler effects, such as alpha-blending images/ text over the video or transforming the final image.

    3) You get a better overall experience, because things like Print Screen don't produce odd results and overlapping windows which just happen to contain the overlay mixer colour won't be corrupted.

  • User profile image
    androidi

    As long as there's no hardware overlay, afaik you do not need directshow to do this. With Layered Windows (There's C# examples around) you have an alpha blended image (with text in it) put into a layered window and then play around with the top/topmost to get it show over the video. The trouble is that this technique may not work well with full screen video in all cases - the player could be stealing the "topmost" even after switching to full screen which could be hacked around with continously setting the topmost while your alpha blended image is being shown. In worst case that may cause flicker. I believe SharpReader does this with its popups, possibly with just plain forms (the popups aren't translucent) with moderate success, I do not remember it flickering with WMP playing video fullscreen. However with some games I've seen sometimes the SharpReader popups causing flicker when playing fullscreen. Sucked.

    If you can control which player is used for the video or use your own player, the directshow route may be better if you need other functionality than just to show some label/popup/links/buttons on top of the video.

  • User profile image
    Cannot​Resolve​Symbol

    I got it to work w/ DirectShow...  fast, NO flicker, and I have access to all the GDI stuff I could ever need.  It will antialias to the video background, too...  quality is my main objective here (intended for big-screen projection w/ possibly large audiences) so zero flicker and antialiasing are good.

    Now I just have to write the app to use it...  I was just making sure it was possible at this point (and learned something that will make my life a lot easier in the process--  I can use DirectShow to show static images too!)

  • User profile image
    androidi

    Duh Smiley Didn't go through your question properly. Was writing as if you wanted it to work with any player (externally launched WMP for example).

  • User profile image
    Cannot​Resolve​Symbol

    <offtopic>  AHA!!!  So that's how they do it (layered windows).  That always puzzled me...  I could tell that there was some Windows support for it, though. </offtopic>

  • User profile image
    androidi

    Yeah they "sort of work" in most cases. Personally I'd like to see user controllable popups (perhaps disabled default) to work in full screen games. I know only handful of apps which allow that but seem to require game by game tweaking since there are opengl and various directx versions. With Vista it might become easier, or not. (for fullscreen games)

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.