Determining framerate of video

I have to work with different kinds of video (TV and cinema). Is there a way to determine the encoded framerate by a xoxo command?
This would be enormous helpful for timecode related calculations.
Thanks!

Mac? Win? Linux?

Sorry, I iforgot. I only use Mac.

Often, the framerate is stored within the file as metadata. Depending on the format, there are different ways to extract the metadata.
The metadata isn’t very reliable though (and sometimes missing) so I find it easier to ignore the metadata and figure it out myself.
I use a static build of ffprobe to do this. It handles pretty much all formats.

If you Shell something like this:

ffprobe -v quiet -select_streams v:0 -show_entries stream=avg_frame_rate -of default=noprint_wrappers=1:nokey=1 yourvideo.ext

it gives you output like:

24000/1001

(So in this case, the framerate is 23.9760240 or 23.976)

Here are some more examples: https://trac.ffmpeg.org/wiki/FFprobeTips
Instead of building myself, I use the static builds from http://ffmpegmac.net/ so it’s easier to reference back in the about/copyright section.

For OSX you can use AVFoundation. MBS plugins has a full bag of AVFoundation goodies.

e.g. AVAssetTrackMBS class has a nominalFrameRate property.

like this:

[code] dim f as FolderItem = SpecialFolder.Desktop.Child(“test.mp4”)
dim a as AVAssetMBS = AVAssetMBS.assetWithFile(f)
dim tracks() as AVAssetTrackMBS = a.tracksWithMediaCharacteristic(AVFoundationMBS.AVMediaCharacteristicFrameBased)

for each t as AVAssetTrackMBS in tracks
MsgBox str(t.nominalFrameRate)
next[/code]

Most every video has header bytes which reference the type and format of the video (found in the first few bytes of the file). If you’re familiar enough with using memoryBlocks, you should (fairly easily) be able to find the information you need there.