Available Fields
The following fields are available in parseMedia():
dimensions
MediaParserDimensions | null
The dimensions of the video.
Any rotation is already applied - the dimensions are like a media player would show them.
Use unrotatedDimensions to get the dimensions before rotation.
If the media passed is an audio file, this will return null.
durationInSeconds
number | null
The duration of the video in seconds.
Only returns a non-null value if the duration is stored in the metadata.
slowDurationInSeconds
number
The duration of the media in seconds, but it is guaranteed to return a value.
If needed, the entire video file is read to determine the duration.
However, if the duration is stored in the metadata, it will be used, so it will not read the entire file.
name
string
The name of the file.
container
The container of the file.
size
number | null
The size of the input in bytes.
mimeType
string | null
The MIME type of the file that was returned when the file was fetched.
Only available if using the webReader (default).
slowStructure
The internal structure of the video. Unstable, internal data structure, refer to the TypeScript types to see what's inside.
fps
number | null
The frame rate of the video.
Only returns a non-null value if the frame rate is stored in the metadata.
slowFps
number
The frame rate of the video, but it is guaranteed to return a value.
If needed, the entire video file is read to determine the frame rate. However, if the frame rate is stored in the metadata, it will be used, so it will not read the entire file.
videoCodec
MediaParserVideoCodec | null
The video codec of the file.
If multiple video tracks are present, this will be the first video track.
One of "h264", "h265", "vp8", "vp9", "av1", "prores" or null (in case of an unknown codec).
audioCodec
MediaParserAudioCodec | null
The audio codec of the file.
If multiple audio tracks are present, this will be the first audio track.
One of 'aac', 'mp3', 'aiff', 'opus', 'pcm', 'flac', 'unknown' (audio is there but not recognized) or null (in case of no audio detected).
metadata
Metadata fields such as ID3 tags or EXIF data.
See metadata for more information.