Report which dependency programs tidymedia can find
Source:R/program_management.R
program_status.Rdprogram_status() looks for the four programs that the package uses:
ffmpeg, ffprobe, ffplay and mediainfo. It returns a table with one
row for each program. The row shows where the program is and which version
it reports. The call does not install, write or change anything.
Value
A tibble with one row for each program and three columns:
program, the name of the program.location, the path to the program, orNA.version, the version that the program reported, orNA.
Details
The call looks in the same places as find_ffmpeg(). First it looks on the
PATH, then at a location saved by set_program(). For locations saved by
versions before 0.2.0, see the section "Locations saved by earlier versions"
in find_ffmpeg().
A program that is not installed and has no saved location gets NA in both
columns. This case gives no warning, so four missing programs give one table
and not four warnings.
A saved location that cannot be used still gives a warning. Without it, the
NA would look like a program you never had. Each warning names the saved
location or the file that holds it, so you can fix it. There are three cases:
tidymedia_location_gone: no program is at the saved location now.tidymedia_location_not_executable: a file is there, and it cannot be run. Give it permission to execute, or save another copy. This case does not arise on Windows, which has no execute bit.tidymedia_location_unreadable: the file that stores the location does not hold exactly one location, or the package cannot read it, or a folder is where that file belongs.
In all three cases, the row has NA in both columns. For a location that is
gone or cannot be run, or a file that does not hold one location,
unset_program() forgets the location, and set_program() replaces it.
For a file the package cannot read, give the file read permission, or use
unset_program() to remove it. unset_program() also removes an empty
folder where the file belongs, and set_program() removes one in the
current folder. Neither removes a folder that holds anything or that the
package cannot read, so delete that folder by hand.
The version is what the program reports about itself. For ffmpeg,
ffprobe and ffplay, it is the FFmpeg build number. For mediainfo, it is
the MediaInfo library version.
Sometimes the call finds a program but cannot get its version. Then the row
has a location and an NA version. This happens when the program call fails.
It also happens when the time limit in options(tidymedia.timeout = ) stops
it.
See also
find_ffmpeg() and the other find_*() functions to look up one
program. set_program() to save the location of a program that is not on
the PATH. unset_program() to forget a saved location.
Other program management functions:
find_ffmpeg(),
install_on_win(),
set_program(),
unset_program()
Examples
# One row per program; NA where the program was not found
program_status()
#> # A tibble: 4 × 3
#> program location version
#> <chr> <chr> <chr>
#> 1 ffmpeg /usr/bin/ffmpeg 8.0.1-3ubuntu2
#> 2 ffprobe /usr/bin/ffprobe 8.0.1-3ubuntu2
#> 3 ffplay /usr/bin/ffplay 8.0.1-3ubuntu2
#> 4 mediainfo /usr/bin/mediainfo 26.01