I have a script which works like this:
Open a Quicktime movie
Move the playhead to where the actiual movie starts (usually 2 seconds after the client’s logo/2-pop)
Run the script
The script calculates the movie’s frame rate and size, trims off the start up to the playhead, and splices on a new logo/2-pop based on the size and frame rate calculated.
This has been working great for most movies we get, which are usually H264/Mp4 containers.
However, the script fails if the movie is “AVC” encoded, because it can’t calculate the frame rate.
Here is how I calculate the frame rate:
set the_video_track to (the first track of document 1 whose type is "vide")
tell document 1 set totalduration to duration of the_video_track
set NumberOfFrames to count frames of the_video_track set timeScaleOfMovie to the time scale
end tell set my_duration to (totalduration / timeScaleOfMovie) set FPS to NumberOfFrames / my_duration
For most movies this works. But for AVC encoded movies, “count frames” yields the result “1”
Any idea why?
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 |