| get_duration | R Documentation |
get_duration() uses the MediaInfo program to look up the duration of a
media file. You choose the section of the file and the unit.
get_duration(
file,
section = c("General", "Video", "Audio"),
unit = c("ms", "sec", "min", "hour")
)
file |
A character vector of one or more media file paths. |
section |
A string indicating the MediaInfo section from which to query
the duration value. Can be either |
unit |
A string indicating whether the duration should be returned in
milliseconds ( |
The function returns one number for each file. The probe_*() functions,
mediainfo_query() and mediainfo_template() return tibbles instead.
A double vector (one per file) giving the duration of the specified section in the specified units.
mediainfo_parameter() for arbitrary MediaInfo fields, and
probe_all() to read information with FFprobe.
Other metadata functions:
get_frame_rate(),
get_height(),
get_sample_rate(),
get_width(),
mediainfo_parameter(),
mediainfo_query(),
mediainfo_template(),
probe_all(),
probe_container()
video <- system.file("extdata", "sample.mp4", package = "tidymedia")
get_duration(video, unit = "sec")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.