get_duration: Get the duration of a media file

View source: R/mediainfo.R

get_durationR Documentation

Get the duration of a media file

Description

Use MediaInfo to quickly look up the duration of different sections of a media file in various units.

Usage

get_duration(
  file,
  section = c("General", "Video", "Audio"),
  unit = c("ms", "sec", "min", "hour")
)

Arguments

file

A string containing the file path of a media file.

section

A string indicating the MediaInfo section from which to query the duration value. Can be either "General", "Video", or "Audio" (default = "General").

unit

A string indicating whether the duration should be returned in milliseconds ("ms"), seconds ("sec"), minutes ("min"), or hours ("hour") (default = "ms").

Value

A double indicating the duration of the specified section of the file (in the specified units).

See Also

Other mediainfo functions: get_framerate(), get_height(), get_samplingrate(), get_width(), mediainfo(), mediainfo_parameter(), mediainfo_query(), mediainfo_template()

Other convenience functions: get_framerate(), get_height(), get_samplingrate(), get_width()


jmgirard/tidymedia documentation built on June 15, 2024, 1:52 p.m.