Re: AppleScript-Users Digest, Vol 11, Issue 494
Re: AppleScript-Users Digest, Vol 11, Issue 494
- Subject: Re: AppleScript-Users Digest, Vol 11, Issue 494
- From: Emmanuel LEVY <email@hidden>
- Date: Sat, 13 Dec 2014 17:22:18 +0100
Just in case, I cannot entirely exclude that you could open the movie in Smile and follow the same process as you are describing, and I'm pretty sure Smile will expose the movie's path as its "path name" property.
Best,
Emmanuel
On Dec 13, 2014, at 3:16 PM, Jim Weisbin wrote:
> Shane Stanley wrote:
>
>> No, and I don't know much about video. But I have a video file here that VLC tells me is H264 - MPG-4 AVC (avc1). And when I run this:
>>
>> use AppleScript version "2.3.1"
>> use scripting additions
>> use framework "Foundation"
>> use framework "AVFoundation"
>>
>> set anNSURL to current application's |NSURL|'s fileURLWithPath:"/path/to/video"
>> set theAsset to current application's AVURLAsset's URLAssetWithURL:anNSURL options:(missing value)
>> set theTrack to (theAsset's tracksWithMediaType:(current application's AVMediaTypeVideo))'s objectAtIndex:0
>> set theFrameRate to theTrack's nominalFrameRate()
>> set theSize to theTrack's naturalSize()
>> return {theFrameRate, width of theSize, height of theSize}
>>
>>
>> I get:
>>
>> --> {29.969722747803, 946.065490722656, 512.0}
>
> I can also get the frame rate with this do shell script:
>
> ffprobe '/path/to/video' 2>&1| grep ",* fps" | cut -d "," -f 6
>
> Both methods (and there are probably other ways) presuppose that I know the path to the movie, but I don’t. I am operating on a movie which is already open in Quicktime - the frontmost movie. We assign the script to a key so that we can execute it when the wiper is set where we need it to be. There is no way, that I know of, to first choose a file (thus getting it’s URL), then open it in Quicktime, pause the script and give control to QT, then wait for the user to move the wiper to where it needs to be, then continue running the script. And, as far as I can tell, QT7 exposes the name of the movie to AS, but not it's path.
>
> The catch-22 here is that QT7 can play, but cannot export at a frame rate of 23.98, which seems to be the new standard for our clients. If it could, I could simply export the movie to an H264/Mp4 container before opening it. As it is now, I have to use other means to export it, such as MpegStreamClip.
>
>
> Jim Weisbin | C.T.O. | human | 138 Fifth Avenue | 3rd Floor | New York, NY | 10011 | (212) 352-0211 | (917) 375-2272 | Los Angeles Office | 2046 Broadway | Santa Monica, CA | 90404 | (310) 264-0211 telephone | www.humanworldwide.com
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden