PDA

View Full Version : calling quicktime from maya with quicktimeTcl


colagor
06-18-2008, 09:50 PM
OK i am trying to set up a MEL script , which will do a play blast and use the system command to call a Tcl script, which in turn will run Quicktime (through QuickTimeTcl (http://quicktimetcl.sourceforge.net/) ) and grab the tiff sequence playblast and compile it into a .mov and open it.

its all based on an old post here:
CGTalk - Quicktime playblast in maya 6 ? (http://forums.cgsociety.org/showthread.php?f=7&t=153341&highlight=quicktime)

i know very little about Tcl script, i just did a couple of tutes yesterday. what i dont understand is how the global proc works, in maya you source the script and you can use the name you put just after the proc command, and then you can use this name like a command within another script.
how does this work with Tcl? or is this the wrong way to get arguments into the command line, which in this case happens to be the mel system command.
the Tcl script itself is just a slightly modified version of one of the examples that comes with QuicktimeTcl.

but this is what i have so far;

The very simple mel script:

playblast -format image -filename "playblast" -clearCache 1 -viewer 0 -showOrnaments 0 -fp 4 -percent 50;
string $imgLoc = ((`workspace -q -fn`) + "/images/");
string $compiledCommand = ("C:/Tcl/quickBlast.tcl " + $imgLoc);
system($compiledCommand);


Heres the Tcl
proc quickBlast {$directory} {

expr
{
package require QuickTimeTcl 3.0

set lfile [ glob -type f [file join $directory *.tiff] ]
foreach f $lfile {
lappend imageList [image create photo -file $f]
}

movie .m
.m new zzz.mov
.m tracks new video 360 288
pack .m
update
set frameDuration [expr 600 / 25]
.m tracks add picture 1 0 $frameDuration $imageList -dialog 0 -keyframerate 25
.m save
}


}

jj80
06-19-2008, 07:40 AM
Not sure if it helps, but quicktime can play back most avi codecs these days. So if you just link .avi's on your machine to open with quicktime instead of media player or something similiarly digusting, you automatically get the quicktime player functionailities without having to use .mov's. ie, on windows, right click on a avi > open with > quicktime, tick "always open with yadayada" and in maya in your playblast options select viewer: movie player.

not exactly what you were asking for, but maybe it helps.

Otherwise, you can also use the com interface to quicktime through python to control it.

colagor
06-19-2008, 09:18 PM
well, the last thing you mentioned about using the com to run a python script is similar to what i had in mind, but im not great with python either, and have never used it outside maya, and the whole point of this is to completely automate the proccess, so it can be used for playblasts.
i am trying to use the .mov (mpeg4) format for the rushes/playblast so we can upload them straight to our forum, although other container and compression (small) formats would work to, so long as the average user can play them.

EmilP
07-19-2008, 09:39 PM
download link below
http://www.highend3d.com/maya/downloads/mel_scripts/utility_external/export/QuickTime-playblast-for-Windows-5318.html

My script picks up the playblasted image sequence and converts it to mov in the background by writing this TCL script below.

package require QuickTimeTcl 3.0
set lfile [ glob -type f [file join usertmp/*.png] ]
foreach f $lfile {
lappend imageList [image create photo -file $f]
}
movie .m
.m new pbHolder.mov
.m tracks new video 640 480
pack .m
update
set timeScale 625
set numFrames 25
set frameDuration [expr 625 / 25]
.m tracks add picture 1 0 $frameDuration $imageList -dialog 0 -keyframerate 25
.m save
.m export -file playblast.mov -dialog 1
return;

ewerybody
07-21-2008, 10:50 AM
pardon me but:
Why the heck is QuickTime so popular? Its clumsy, slow and not open to anything! Why are people not using VirtualDub (http://VirtualDub.org), maybe Media Player Classic and xVid (http://xVid.org) to do such stuff?

Is it only because of good scrubbing? well VirtualDub has the best scrubbing I've ever seen! But ok It does not play mov and wmv but it loads in a fraction of the time QT takes! If on a website the browser hangs up half a minute to load that Quicktime plugin! I'd have seen the video in flash long ago!

jj80
07-21-2008, 12:39 PM
two words: industry standard.

ewerybody
07-21-2008, 01:57 PM
one word: b0ll0cks

if people resist to open their eyes because of "hey everybody else is doing the stupid thing too" then poor industry!!
In times of flash and web2.0: Quicktime is so last century! imho!!

i mean.. sorry but thats no answer! :/

jj80
07-21-2008, 02:36 PM
well, no point arguing about that i guess, didn't mean to be offensive.

and it propably depends where you work. But if you want to make sure that your movie is as compatible as possible, there's hardly a way around quicktime. I've used the sdk and know how bad QT is, but sometimes these factors aren't the deciding ones.
Have a look at any pipeline of large vfx facitlities, there are quicktimes all over the place... it just is the industry standard - and if you are sharing files with ppl in the industry, your most important decision should be compatability and quality.

is that an answer :P ?

Buexe
07-22-2008, 12:14 AM
two words: frame stepping

haven`t seen another player besides QT that allows decent framestepping per arrow keys, except framecycler. Though for playblasts I use divx ;o)

ewerybody
07-22-2008, 10:55 AM
yea okokok, I can't tell much about film industry as I'm in games for many years now.
In terms of compatiblity? I'd definitely choose MPEG1! Every system can play that! Even without installing anything. You'd have to compress it good for quality though.
And jep jj80: Thanks thats more like it ;]

@Buexe: Media Player Classic (http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84358) has that as well! And it has doubleclick for fullscreen without paying Apple!! If It doesn't play mov out of the box, get quickTimeAlternative (http://www.free-codecs.com/download/quicktime_alternative.htm). Its a actually a plugin for Media Player Classic (but its shipped with Media Player Classic as well)
And VirtualDub even Plays image sequences like a breeze! Just pick image00001.jpg over VirtualDub and it loads the entire anim. I haven't seen anything better yet... And all loads up in a snap, is for free and open source!...

I mean I don't want to evangelize you but ... ( ok maybe I want!! ) I just learned to hate QT as it hangs up randomly, freezes the browser, installs tray icon and useless, invisible background tasks, akts like an alien on a windows system and is so darn clumsy and slow.. I'm really avoiding it!

pardon if I sounded like a hole that starts with an s... ;]

jj80
07-22-2008, 11:13 AM
some good info there, thanks mate!

Buexe
07-22-2008, 12:35 PM
I mean I don't want to evangelize you but ... ( ok maybe I want!! ) I just learned to hate QT as it hangs up randomly, freezes the browser, installs tray icon and useless, invisible background tasks, akts like an alien on a windows system and is so darn clumsy and slow.. I'm really avoiding it!

Well, my QT regularly tries to downlad updates which for some reason it is not able to, wants me to dowwnload and start the installer manually. Of course this doesn`t work either, so please don`t think that I`m a fan of QT. And aside from that, where I work a lot of editing is done in Final CUt=Apple=QT so ...
Great to know there are alternatives, but please understand that I`m not interested in a "Does the world need QT" or similar debate. I`m not religuos about who should use what, thanks.

ewerybody
07-22-2008, 03:25 PM
hey all cool?
I was just wondering whats so great about QT: And there we see: probably just habits.

Everyone useses what he or she wants. You know about alternatives. Thats ok I think. The part you quoted wasn't adressed to you directly. Its just my viewpoint.

Buexe
07-22-2008, 04:59 PM
yeah, it`s all cool ,it`s just that the topic is not "what`s so great about quicktime" and there are a few reasons why peeps use it so it is more than a habit and debating that here is simply OT.

Ahoi ins dicke b!

CGTalk Moderation
07-22-2008, 04:59 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.