| mediainfo_parameter | R Documentation |
mediainfo_parameter() uses the MediaInfo program to read one value, such as
the video width, from media files. MediaInfo groups its values in sections,
such as "General", "Video" and "Audio". You name the section and the
parameter to read.
mediainfo_parameter(file, section, parameter, typed = TRUE)
file |
A character vector of one or more media file paths. |
section |
A string. The name of the MediaInfo section to read
|
parameter |
A string. The name of the MediaInfo parameter to read from
|
typed |
A logical. If |
Give several files in file to get one value for each file. The function
returns a vector, not a tibble. The probe_*() functions read similar
information with FFprobe and return tibbles.
A vector with one value for each element of file. A value is NA
when MediaInfo prints more than one line, for example for a section it
does not know. A parameter that section does not have gives an empty
value. That value is NA when typed = TRUE and "" when
typed = FALSE. A value is also NA for a file that does not exist or
that reaches the time limit.
The function does not stop at those files. It reads the other files, and
then gives one warning that names the files that do not exist or reached
the limit. See with_timeout() for the time limit.
mediainfo_query() to read several parameters at once.
mediainfo_template() to apply a whole template. probe_all() to read
information with FFprobe. get_duration() and the other get_*()
functions for common single values.
Other metadata functions:
get_duration(),
get_frame_rate(),
get_height(),
get_sample_rate(),
get_width(),
mediainfo_query(),
mediainfo_template(),
probe_all(),
probe_container()
video <- system.file("extdata", "sample.mp4", package = "tidymedia")
mediainfo_parameter(video, section = "Video", parameter = "Width")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.