Read video frame rate and resolution

I'd like to use an AppleScript to read the frame rate and resolution of a video. In QuickTime I can open the file inspector and see the frame rate (FPS) and current size, along with other info. Does applescript have access to this same info via QuickTime? If so, how can I read it fps and current size?

Mac Pro, 8-core, Mac OS X (10.5.7), Two NVIDIA GeForce 7300GT

Posted on Feb 26, 2011 3:29 PM

Reply
4 replies

Feb 28, 2011 7:45 AM in response to Scott216

Maybe like this:

*tell application "QuickTime Player"*
activate
* if not (document 1 exists) then return beep 1*
* tell application "System Events" to tell process "QuickTime Player"*
* if not ((window 1 whose name ends with "Inspector") exists) then*
* keystroke "i" using {command down}* -- “Show Movie Inspector” menu command
* end if*
* set theInspector to window 1 whose name ends with "Inspector"*
--The frame rate:
* set {X, Y} to position of static text 1 of theInspector whose value is "FPS:"*
* set theFrameRate to value of text area 1 of theInspector whose position is {X + 120, Y}*
--The resolution:
* set {X, Y} to position of static text 1 of theInspector whose value is "Current Size:"*
* set theResolution to value of text area 1 of theInspector whose position is {X + 120, Y}*
--Optional:
* set theFrameRate to theFrameRate as integer*
* set {H, V} to {word 1, word 3} of theResolution*
* set theResolution to {H as integer, V as integer}*
* end tell*
*end tell*
*{theFrameRate, theResolution}*


Of course, since the above script uses [GUI Scripting|http://www.macosxautomation.com/applescript/uiscripting/index.html], you must enable the Accessibility Frameworks by clicking the checkbox labeled "Enable access for assistive devices" in the Universal Access System Preference pane.

Message was edited by: Pierre L.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Read video frame rate and resolution

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.