Skip to contents

This function stores an R data object (data frame, list, etc) within a metadata tag inside a video file. This is primarily intended to store video-specific information, so that this information is carried with the video file itself. By default the ov_court_info metadata tag is used (intended to store the geometry of the playing court in the video, see Examples).

Usage

ov_set_video_data(
  video_file,
  obj,
  tag = "ov_court_info",
  b64 = TRUE,
  replace = FALSE,
  overwrite = FALSE
)

Arguments

video_file

string: path to the video file

obj

: data object to store, typically a list as returned by ov_shiny_court_ref(). obj will be serialized and base64-encoded before storing unless b64 = FALSE

tag

string: the tag name to use

b64

logical: serialize obj and base64-encode before storing?

replace

logical: if FALSE and the specified metadata tag is already present in the video file, don't replace it

overwrite

logical: if TRUE overwrite the video_file, otherwise create a new file in the temporary directory. See ov_set_video_meta() for details

Value

The path to the video file

Examples

if (FALSE) {
  if (interactive()) {
    ## mark the geometry of the court in the video
    ref <- ov_shiny_court_ref(video_file = ov_example_video(), t = 5)

    ## store it
    newfile <- ov_set_video_data(ov_example_video(), obj = ref)

    ## retrieve it
    ov_get_video_data(newfile)
  }
}