Win32::OLE / WMEncoderAgent issue

S

Simon Lockhart

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
 
P

pkent

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
 
S

Simon Lockhart

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
 
P

pkent

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top