Quicktime Scripting & RTSP

Using scripting to control Quicktime Movies when those movies are for streaming looses Audio Video Sync. It isn’t really apparent at first but certain function calls should cause the audio to stop or even slow down along with the video. When function calls are made the video reacts but the audio does not. I have reported the issue to Apple and they are currently working on it. Continue to read if you want to know the specifics of the issue…

All scripting controls work great with progressive download movies but choke with files prepared for rtsp://. Any function calls that slow down the movie will only slow the video. The audio plays at normal speed and eventually looses sync with the video. This will happen using Javascript, Applescript, or VBScript.

The problem can be reproduced directly in the QT Player with the following AppleScript:

tell application "QuickTime Player"
open location movieURL
tell first movie
--hang out until the movie starts
repeat while the rate < 1
delay 1 --sleep for a second before checking again
end repeat
set rate to 0.5
end tell
end tell

The Result
The Audio keeps playing at normal speed and the video is the only track that plays in slow motion.

This issue doesn’t happen with Progressive download QT files. It also doesn’t happen if you play a streaming file through the HTTP embedding for the QT plug-in. This isn’t an option to fix it because an rtsp server should really be used with this file type. Another problem is that other scripting features don’t work when you play an rtsp file with http embedding.

This is the jist of the problem…I hope this helps others who are going crazy trying to figure out what they are doing wrong. You aren’t doing anything wrong. It is Apple’s problem.

One thought on “Quicktime Scripting & RTSP

Leave a Reply