[Pythonmac-SIG] Play Quicktime mov

has hengist.podd at virgin.net
Wed Oct 12 14:04:39 CEST 2005


Corrie Tse wrote:

>Basically all i want to do is play a mov file from a
>specific time code.

Using appscript <http://freespace.virgin.net/hamish.sanderson/appscript.html> to control the front movie in QuickTime Player:

#!/usr/bin/env pythonw

from appscript import *

starttime = 30 # seconds

m = app('QuickTime Player').movies[1]
timescale = m.time_scale.get()
m.current_time.set(starttime * timescale)
m.play()


If you need to open the movie from file first:

#!/usr/bin/env pythonw

from appscript import *
from macfile import File

moviepath = '/Users/has/Movies/some.mov'
starttime = 30 # seconds

m = app('QuickTime Player').open(File(moviepath))
timescale = m.time_scale.get()
m.current_time.set(starttime * timescale)
m.play()


Calculates the start time based on seconds rather than timecodes, but modifying it to use the latter shouldn't be hard.

HTH

has
-- 
http://freespace.virgin.net/hamish.sanderson/


More information about the Pythonmac-SIG mailing list