• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Quicktime frame rate calculation error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Quicktime frame rate calculation error


  • Subject: Quicktime frame rate calculation error
  • From: Jim Weisbin <email@hidden>
  • Date: Fri, 12 Dec 2014 13:14:13 -0500

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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Quicktime frame rate calculation error
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Javascript for automation quastions
  • Next by Date: Re: Quicktime frame rate calculation error
  • Previous by thread: Re: Javascript for automation quastions
  • Next by thread: Re: Quicktime frame rate calculation error
  • Index(es):
    • Date
    • Thread