Sign in to follow this  
Followers 0
james3mg

Quicktime COM trouble

4 posts in this topic

I'm hoping someone out there who has done more work with Quicktime's COM objects can give me a hand:

The long-range goal is to be able to tell how long a move or audio file is, in minutes and seconds.

kjactive's post at http://www.autoitscript.com/forum/index.ph...st&p=114957 got me going, but I first had to play around until I found that my computer required a different number at the end of the appname.objectype string: he used Quicktime.Quicktime.4, and I need to use Quicktime.Quicktime.5 or .6 on my machine. Since I want to distribute the completed script this will be a part of, I decided to make sure I can get the right number on each computer with:

For $i=@YEAR-1996 To 1 Step -1;should be safe in trying all possible versions - installs from 2007 are only version 5 or 6, and this would check up through 11.
    $QTobj=ObjCreate("QuickTime.QuickTime."&$i)
    If NOT @error Then ExitLoop
Next
If NOT IsObj($QTobj) Then
    MsgBox(16,"Error","You need to have Quicktime on this computer to use this program")
    Exit
EndIfoÝ÷ ÚÊßÙejÊÆ޺ȧØ^ßÙZµë-ßÛޮȨø§víç(­z·(è]4ÓK)j{-ÊWoÝ÷ ÙDK¡»â¢ë%Éö¤zÚ7öZwmæ®v*WÁ©í¶!yÉ-éàzÛbazh§º×¬jwlyÊ'vˬxºÚ"µÍÌÍÓ[ÝIÌÍÔUØÙ]][Û
KÉÌÍÔUØÙ][YTØØ[J
BÌÍÓ[Z[QÛÜ ÌÍÓ[ÝÍ
BÌÍÓ[ÙXÏTÝ[
    ÌÍÓ[ÝJ

ÛÜ    ÌÍÓ[ÝÍ
JJJBÛÛÛÛUÜ]J   ÌÍÓ[Z[[É][ÝÎ][ÝÉ[ÉÌÍÓ[ÙXÉ[ÐÔ
...it comes out perfectly. The problem is that I want to be able to find the length of a file that's on the local computer! The audio file is in the same folder as the script, so I've tried:
.SetUrl("file.m4a")
.SetUrl("c:\path\file.m4a")
.SetUrl("c:/path/file.m4a")
.SetUrl(@ScriptDir&"\file.m4a")
.SetUrl(file://c:\path\file.m4a")
.SetUrl("file://c:/path/file.m4a")
.SetUrl("c:\\path\\file.m4a")
.SetUrl("c://path//file.m4a")
.SetUrl("file://c:\\path\\file.m4a")
.SetUrl("file://c://path//file.m4a")
...all to no avail! Does anyone know if/why it's not possible to load a local audio file using COM like Quicktime itself does? http://developer.apple.com/documentation/Q...hatsNew-74.html doesn't list anything that looks like an alternate method to .SetUrl() that would work locally, and http://developer.apple.com/quicktime/activexcontrol.html seems to use the same method whether loading local or web files, but maybe I'm missing something, since I REALLY don't understand COM too well (though I've learned a lot recently)

Third (last) question:

Can anyone see why a movie (.MP4) file can't be loaded (from a web server) the same way as an audio (.m4a) file? Quicktime loads them both fine itself, but COM doesn't seem to like it. And I HAVE checked the path for typos; the path should be the only thing that changes, but I start getting errors when I plug in a video file's path instead.

Thanks for your time and help! :)

P.S. I'll slip one more question in there: does anyone know of better documentation of the Quicktime COM controls (objects, whatever) than I've been able to find (linked to here)? Thanks!


"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

I have no experience Quicktime, but with COM...

1) use the version-independant string instead: Quicktime.Quicktime

this gets the latest version. When might this be a bad idea? Only if you are using a method or property introduced in say, .4, and the user only has .3. Typically not going to be a roblem for you.

2) I found a reference to this syntax working in a Google search: $QTobj.SetURL('C:\goodspeed_426.mov')

3) no idea

4) perhaps here (but it isn't very good): http://developer.apple.com/documentation/Q...inkElementID_15

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Dale:

THANKS for your reply! Sorry for the late rereply...I was out today.

That way of getting the latest version makes ... well ... a LOT of sense! Thanks for pointing that out to me - as I said, I'm still learning all this COM stuff.

I'll look for the page you found with Google-maybe they have a better-working implementation that I can use as a springboard...I just can't seem to get this rolling at all. .SetAutoplay(False) didn't even work for me like it should have - I had to use .SetRate() to 0 to pause it as soon as it's loaded! Maybe the QT people haven't got COM quite right...

Re: the link you gave me - I appreciate it, but that's pretty similar to everything I've been finding - the source of my problem: the only quicktime anyone seems to care about is the browser plugin, so everything's in Javascript! According to Apple, they're two totally different animals, but I can't find real com-specific documentation.

Oh well

Thanks for the effort! I'll keep trying, and hoping that maybe someone in the AI world has delved into quicktime and sees this :)


"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

Maybe the QT people haven't got COM quite right...

Isn't QuickTime the Apple programmers' revenge on Windows users? :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0