Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
AVAsset.TrackInfo
Queries track details.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
AVAsset | 7.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |
Parameters
Parameter | Description | Example |
---|---|---|
Asset | The reference number of the asset. Please use AVAsset.OpenContainer, AVAsset.OpenFile or AVAsset.OpenURL function to get asset reference. | $asset |
TrackIndex | The track index from 0 to AVAsset.TrackCount-1. | 0 |
Selector | Which value to get. | "MediaType" |
Result
Returns value or error.
Description
Queries track details.Allows you to query values for track.
Selector | Description |
trackID | Indicates the persistent unique identifier for this track of the asset |
mediaType | Indicates the media type for this track as 4 letter code. e.g. "vide" for video or "soun" for sound. |
playable | Indicates whether the receiver is playable in the current environment. |
enabled | Indicates whether the track is enabled according to state stored in its container or construct. |
selfContained | Indicates whether the track references sample data only within its storage container. |
totalSampleDataLength | Indicates the total number of bytes of sample data required by the track. |
estimatedDataRate | Indicates the estimated data rate of the media data referenced by the track, in units of bits per second. |
naturalTimeScale | Indicates a timescale in which time values for the track can be operated upon without extraneous numerical conversion. |
languageCode | Indicates the language associated with the track, as an ISO 639-2/T language code; may be "" if no language is indicated. |
extendedLanguageTag | Indicates the language tag associated with the track, as an IETF BCP 47 (RFC 4646) language identifier; may be "" if no language tag is indicated. |
naturalWidth | Indicates the natural dimensions of the media data referenced by the track. |
naturalHeight | Indicates the natural dimensions of the media data referenced by the track. |
preferredVolume | Indicates the volume specified in the track's storage container as the preferred volume of the audible media data. |
nominalFrameRate | For tracks that carry a full frame per media sample, indicates the frame rate of the track in units of frames per second. |
minFrameDuration | Indicates the minimum duration of the track's frames; the value will be kCMTimeInvalid if the minimum frame duration is not known or cannot be calculated. |
timeRangeStart | Indicates the time range of the track within the overall timeline of the asset |
timeRangeDuration | Indicates the time range of the track within the overall timeline of the asset |
preferredTransform | Indicates the transform specified in the track's storage container as the preferred transformation of the visual media data for display purposes; its value is often but not always identity |
MediaSubType | The media subtype (codec). |
formatDescription | Asks AVAsset for a description of the first format in the track. (Added in 15.0) |
Code | Name | Description |
2vuy | 422YpCbCr8 | Component Y'CbCr 8-bit 4:2:2 ordered Cb Y'0 Cr Y'1 |
rle | Animation | Apple Animation format |
cvid | Cinepak | Cinepak format |
jpeg | JPEG | Joint Photographic Experts Group (JPEG) format |
dmb1 | JPEG_OpenDML | JPEG format with Open-DML extensions |
SVQ1 | SorensonVideo | Sorenson video format |
SVQ3 | SorensonVideo3 | Sorenson 3 video format |
h263 | H263 | ITU-T H.263 format |
avc1 | H264 | ITU-T H.264 format (AKA ISO/IEC 14496-10 - MPEG-4 Part 10, Advanced Video Coding format) |
hvc1 | HEVC | ITU-T HEVC format |
mp4v | MPEG4Video | ISO/IEC Moving Picture Experts Group (MPEG) MPEG-4 Part 2 video format |
mp2v | MPEG2Video | MPEG-2 video format |
mp1v | MPEG1Video | MPEG-1 video format |
dvc | DVCNTSC | DV NTSC format |
dvcp | DVCPAL | DV PAL format |
dvpp | DVCProPAL | Panasonic DVCPro PAL format |
dv5n | DVCPro50NTSC | Panasonic DVCPro-50 NTSC format |
dv5p | DVCPro50PAL | Panasonic DVCPro-50 PAL format |
dvhp | DVCPROHD720p60 | Panasonic DVCPro-HD 720p60 format |
dvhq | DVCPROHD720p50 | Panasonic DVCPro-HD 720p50 format |
dvh6 | DVCPROHD1080i60 | Panasonic DVCPro-HD 1080i60 format |
dvh5 | DVCPROHD1080i50 | Panasonic DVCPro-HD 1080i50 format |
dvh3 | DVCPROHD1080p30 | Panasonic DVCPro-HD 1080p30 format |
dvh2 | DVCPROHD1080p25 | Panasonic DVCPro-HD 1080p25 format |
ap4h | AppleProRes4444 | Apple ProRes 4444 format |
apch | AppleProRes422HQ | Apple ProRes 422 HQ format |
apcn | AppleProRes422 | Apple ProRes 422 format |
apcs | AppleProRes422LT | Apple ProRes 422 LT format |
apco | AppleProRes422Proxy | Apple ProRes 422 Proxy format |
Examples
Query media subtype:
MBS( "AVAsset.TrackInfo"; $Asset; 0; "MediaSubType" )
Let([
asset = MBS( "AVAsset.OpenFile"; "/Users/cs/Downloads/test.mp3" );
formatDescription = MBS( "AVAsset.TrackInfo"; Asset; 0; "formatDescription" );
r = MBS( "AVAsset.Release"; Asset )
]; formatDescription)
Example result:
{
mediaType:39;soun'
mediaSubType:'.mp3'
mediaSpecific: {
ASBD: {
mSampleRate: 44100.000000
mFormatID: '.mp3'
mFormatFlags: 0x0
mBytesPerPacket: 0
mFramesPerPacket: 1152
mBytesPerFrame: 0
mChannelsPerFrame: 2
mBitsPerChannel: 0 }
cookie: {(null)}
ACL: {(null)}
FormatList Array: {
Index: 0
ChannelLayoutTag: 0x650002
ASBD: {
mSampleRate: 44100.000000
mFormatID: '.mp3'
mFormatFlags: 0x0
mBytesPerPacket: 0
mFramesPerPacket: 1152
mBytesPerFrame: 0
mChannelsPerFrame: 2
mBitsPerChannel: 0 }}
}
extensions: {(null)}
}
See also
Release notes
- Version 14.6
- Added formatDescription as selector for AVAsset.TrackInfo to query format description information.
- Version 7.4
- Added AVAsset.TrackInfo function.
Example Databases
Blog Entries
This function checks for a license.
Created 29th July 2017, last changed 22nd November 2024