Win32::OLE / WMEncoderAgent issue

Discussion in 'Perl Misc' started by Simon Lockhart, Apr 7, 2004.

  1. Apologies if this is the wrong place to ask, but if so would appreciate
    pointers in the right direction.

    I'm trying to manage some Windows Media encoders remotely, using Perl and
    Win32::OLE. I've translated some example VB code from the MSDN website, and
    ended up with the following:

    ----------------8<-----------------------------------
    #! c:\perl\bin\perl.exe

    use strict;
    use Win32::OLE;
    use Data::Dumper;

    my $encagent = Win32::OLE->new(["boc1enc01", "WMEncAgt.WMEncoderAgent"]);
    my $encoder = $encagent->GetEncoder($encagent->EncoderNamesCollection->item(0));

    my $type = Win32::OLE->QueryObjectType($encoder);
    print "Its a ", Dumper($type);

    print $encoder,"\n";

    my $Count = Win32::OLE->EnumAllObjects(sub {
    my $Object = shift;
    my $Class = Win32::OLE->QueryObjectType($Object);
    printf "# Object=%s Class=%s\n", $Object, $Class;
    })
    ----------------8<-----------------------------------

    Now, from my understanding of the MSDN docs, $encoder should be of type
    IWMEncoder, but QueryObjectType returns undef for it. Is this a bug or
    feature? Is there any way to "cast" the object to an IWMEncoder?

    Thanks,

    Simon
    --
    Simon Lockhart | Tel: +44 (0)1628 407720 (x(01)37720) | Si fractum
    Technology Manager | Fax: +44 (0)1628 407701 (x(01)37701) | non sit, noli
    BBC Internet Ops | Email: | id reficere
    BBC Technology, Maiden House, Vanwall Road, Maidenhead. SL6 4UB. UK
     
    Simon Lockhart, Apr 7, 2004
    #1
    1. Advertising

  2. Simon Lockhart

    pkent Guest

    In article <c51pds$4of$>,
    (Simon Lockhart) wrote:
    ....
    > my $encagent = Win32::OLE->new(["boc1enc01", "WMEncAgt.WMEncoderAgent"]);
    > my $encoder =
    > $encagent->GetEncoder($encagent->EncoderNamesCollection->item(0));
    >
    > my $type = Win32::OLE->QueryObjectType($encoder);

    ....
    > Now, from my understanding of the MSDN docs, $encoder should be of type
    > IWMEncoder, but QueryObjectType returns undef for it. Is this a bug or
    > feature? Is there any way to "cast" the object to an IWMEncoder?



    FWIW looking at Real's website it seems that Helix can encode Windows
    Media, and Helix appears to run on Unix :)

    But, one thing you might find useful, if you haven't found it already,
    is the OLE Browser tool that comes with ActivePerl. Start at the perl
    docs index pages which is probably at C:/perl/html/index.html - in the
    lefthand nav under "Windows Specific" there's a link to the OLE Browser.
    Follow that link and you get a list of all the libraries etc. available,
    which you can click on to get details of their classes, methods,
    properties, etc. You might find something there, maybe.

    That said, is $encoder actually defined? Is it is, does it do what it's
    supposed to do? I mean might it just be that you have a perfectly valid
    object in $encoder but, for some reason, QueryObjectType() returns undef
    even though the object exists?

    P

    --
    pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
    Remove the tea to reply
     
    pkent, Apr 9, 2004
    #2
    1. Advertising

  3. In article <>,
    pkent <> wrote:
    >FWIW looking at Real's website it seems that Helix can encode Windows
    >Media, and Helix appears to run on Unix :)


    It can? I've not seen that - URL?

    >But, one thing you might find useful, if you haven't found it already,
    >is the OLE Browser tool that comes with ActivePerl. Start at the perl
    >docs index pages which is probably at C:/perl/html/index.html - in the
    >lefthand nav under "Windows Specific" there's a link to the OLE Browser.
    >Follow that link and you get a list of all the libraries etc. available,
    >which you can click on to get details of their classes, methods,
    >properties, etc. You might find something there, maybe.


    Okay - I'll take a look at that.

    >That said, is $encoder actually defined? Is it is, does it do what it's
    >supposed to do? I mean might it just be that you have a perfectly valid
    >object in $encoder but, for some reason, QueryObjectType() returns undef
    >even though the object exists?


    Yes, $encoder is defined, but I can't use it. Hence my problem ;-)

    Simon
    --
    Simon Lockhart | Tel: +44 (0)1628 407720 (x(01)37720) | Si fractum
    Technology Manager | Fax: +44 (0)1628 407701 (x(01)37701) | non sit, noli
    BBC Internet Ops | Email: | id reficere
    BBC Technology, Maiden House, Vanwall Road, Maidenhead. SL6 4UB. UK
     
    Simon Lockhart, Apr 9, 2004
    #3
  4. Simon Lockhart

    pkent Guest

    In article <c576kb$2vl$>,
    (Simon Lockhart) wrote:

    > In article <>,
    > pkent <> wrote:
    > >FWIW looking at Real's website it seems that Helix can encode Windows
    > >Media, and Helix appears to run on Unix :)

    >
    > It can? I've not seen that - URL?


    Well I was looking at
    http://www.realnetworks.com/products/server/features.html which says
    Helix Universal Server can deliver Windows Media... I'd assumed that it
    could also encode it because of this bit: "Interoperability with all
    default Microsoft codecs shipped with Windows Media Player since version
    6.4" ... but on re-reading I get the feeling that encoding is separate
    from delivery; possibly done with RealProducer (formerly Helix Producer,
    apparently), the windows-based encoders or some other tool. So, maybe
    that isn't any help to you :-/ I suppose I should know a bit more about
    this as my orkplace does a bit of streaming and clip serving.

    P

    --
    pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
    Remove the tea to reply
     
    pkent, Apr 11, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M. David Allen

    Win32::OLE, Excel, and coloring

    M. David Allen, Jun 24, 2003, in forum: Perl
    Replies:
    1
    Views:
    5,397
    Jay Tilton
    Jun 25, 2003
  2. Vinay Gupta
    Replies:
    2
    Views:
    1,110
    Michael Schlenker
    Jul 27, 2004
  3. Patrick.O.Ige

    Ole ole

    Patrick.O.Ige, Jul 16, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    501
    Patrick.O.Ige
    Jul 16, 2006
  4. Drew Pihera
    Replies:
    0
    Views:
    649
    Drew Pihera
    Feb 4, 2004
  5. Lance Hoffmeyer
    Replies:
    0
    Views:
    246
    Lance Hoffmeyer
    Nov 17, 2003
Loading...

Share This Page