Media_GetVideoInfo ( container )
Media_GetVideoInfo gives you detailed information about video files that have been “inserted as QuickTime.” Information returned includes format, duration, video dimensions, frame rate, audio sample rate, etc.
Parameter | Description |
---|---|
container |
Location of the video file. |
To pick out specific pieces of information, use the Media_ExtractInfo function.
Because the information returned by this function is hierarchical and indented, it can be helpful to display the returned information with a font that uses equal character spacing, such as Courier.
Returns
The result is a hierarchical list of metadata values associated with the video and audio tracks in the video file, such as:
Movie
Location: /Users/username/directory/samplevideo.mp4
Size (KB): 0.0
Duration (s): 000:21:00.010
Video
Width (pt): 720
Height (pt): 404
Depth (bits): 24
Sample Format: 61766331
Sample Format Description:
Static Frame Rate: 29.97
Data Rate (kbps): 0.00
Audio
Sample Format: 6D703461
Sample Format Description: MPEG-4 Audio
Compression Type: Variable compression
Sample Rate (Hz): 48000
Sample Size (b): 16
Channels: 2
Channel Layout: a standard stereo stream left, right
Bit Rate (kbps): 128.00
Examples
To place all of the video info in a field named “Video Metadata”:
Set Field [ MyTable::Video Metadata ;
Media_GetVideoInfo (MyTable::Container) ]
To put the video width and height values into separate fields:
Set Field [ MyTable::Width ;
Media_ExtractInfo (
Media_GetVideoInfo (MyTable::Container) ;
"Media/Video/Height"
) ]
Set Field [ MyTable::Height ;
Media_ExtractInfo (
Media_GetVideInfo (MyTable::Container) ;
"Media/Video/Height"
) ]
To isolate the frame rate:
Set Field [ MyTable::Frame Rate ;
Media_ExtractInfo (
Media_GetVideoInfo (MyTable::Container) ;
"Movie/Video/Static Frame Rate"
) ]