View source: R/program_management.R
| set_program | R Documentation |
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.
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)
program |
A string naming the program to set the location for. |
location |
A string with the location of the program. |
confirm |
Whether to ask before the call writes the location. |
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
the call writes, which is the location as you typed it. The one change is a
leading ~, which is written as your home folder in full. The question
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().
Invisibly, TRUE when the call wrote the location and FALSE when
you said no.
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()
## Not run:
# Point tidymedia at a binary in a non-standard location; asks first
set_mediainfo("C:/Program Files/MediaInfo/mediainfo.exe")
# In an unattended script, where there is no one to ask
set_mediainfo("C:/Program Files/MediaInfo/mediainfo.exe", confirm = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.