ov_playlist_to_video | R Documentation |
Make a self-contained video file from a playlist.
ov_playlist_to_video(
playlist,
filename,
subtitle_column = NULL,
seamless = FALSE,
debug = FALSE
)
playlist |
data.frame: a playlist as returned by |
filename |
string: file to write to. If not specified (or |
subtitle_column |
string: if not |
seamless |
logical: if |
debug |
logical: if |
Requires that ffmpeg be available on the system path. Note that the processing of each clip is done inside of a future_lapply
call (if the future.apply
package is installed), and so you can have this part of the processing done in parallel by setting an appropriate futures plan before calling this function.
This function is experimental. In particular it is unlikely to work well with all video formats, and especially if the playlist comprises clips from different videos with different resolution/encoding/etc.
A list with the filenames of the created video and subtitle files.
ov_video_playlist()
## Not run:
my_playlist <- ov_video_playlist(..., type = "local")
video_file <- ov_create_video(my_playlist)
browseURL(video_file[[1]])
## run in parallel, with the scouted codes as subtitles
library(dplyr)
library(future.apply)
plan(multisession)
## note that the example file doesn't have a video associated with it, so
## this example won't actually work in practice
x <- read_dv(dv_example_file())
## fudge the video entry
dv_meta_video(x) <- "~/my_video.mp4"
## make the playlist
my_playlist <- ov_video_playlist(
x$plays %>% dplyr::filter(skill == "Reception") %>% slice(1:10),
meta = x$meta, extra_cols = "code")
## create the video and subtitles files
video_file <- ov_create_video(my_playlist, subtitle_column = "code")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.