-
Notifications
You must be signed in to change notification settings - Fork 0
/
QTController-OSA.py
30 lines (25 loc) · 956 Bytes
/
QTController-OSA.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from appscript import *
import HRTime
import sys
theMovieDoc = app('Quicktime Player 7').open('/Volumes/Win/Video/INRETS/videoTests/LaneSplitting-full.qi2m')
timeScale = float(theMovieDoc.time_scale.get())
duration = theMovieDoc.duration.get()/timeScale
theMovieDocsCurrentTime = theMovieDoc.current_time.get
theMovieDocsNewTime = theMovieDoc.current_time.set
currentTime = theMovieDocsCurrentTime()
theMovieDocsNewTime( duration / 2.0 )
print >>sys.stderr, theMovieDocsNewTime, type(theMovieDocsNewTime), dir(theMovieDocsNewTime)
HRTime.tic()
for i in xrange(int(duration+0.5)):
theMovieDocsNewTime( i * timeScale )
t = HRTime.toc()
print >>sys.stderr, '%d frame steps in %g seconds - %gfps' %(i, t, t/i)
start = HRTime.HRTime()
theMovieDoc.current_time.set(0)
t = HRTime.HRTime() - start
n = 0
while t < duration:
theMovieDocsNewTime( t * timeScale )
t = HRTime.HRTime() - start
n += 1
print >>sys.stderr, '%d frame steps in %g seconds' %(n, t)