set_program() saves the location of a program, so the package can find it
in later sessions. set_ffmpeg(), set_ffprobe(), set_ffplay() and
set_mediainfo() do the same for one program each.
The location goes in a file named after the program, such as
ffmpeg_location.txt. The file is under
tools::R_user_dir("tidymedia", "config"). find_ffmpeg() and the other
find_*() functions read it when the program is not on the PATH.
Usage
set_program(
program = c("ffmpeg", "ffprobe", "ffplay", "mediainfo"),
location,
confirm = TRUE
)
set_mediainfo(location, confirm = TRUE)
set_ffmpeg(location, confirm = TRUE)
set_ffprobe(location, confirm = TRUE)
set_ffplay(location, confirm = TRUE)Details
The file stays after the session ends, so the call asks you to confirm first. It writes nothing until you agree. The question shows the location as you typed it, which is what the call writes. It also shows the full path of the file. If you say no, the call changes nothing.
In a session where no one can answer, the call gives an error. Pass
confirm = FALSE to write without the question, for example in a script
that runs on its own.
For locations saved by versions before 0.2.0, see the section "Locations
saved by earlier versions" in find_ffmpeg().
See also
find_ffmpeg() and the other find_*() functions to find a
program, and install_on_win() to download FFmpeg on Windows.
Other program management functions:
find_ffmpeg(),
install_on_win(),
program_status(),
unset_program()