| refresh_ffmpeg_capabilities | R Documentation |
Discard the package's record of which encoders and codecs your FFmpeg build has. The next query then asks FFmpeg again.
refresh_ffmpeg_capabilities()
The first call in an R session to has_encoder, or one that
uses hardware = "nvenc" or hardware = "videotoolbox", asks
FFmpeg which encoders it has. The package remembers that answer for the rest
of the session. Later calls reuse
it and do not start FFmpeg again each time, so a large batch stays fast.
A run that FFmpeg refuses can also fill the record. After such a run,
ffm_run can ask FFmpeg for its encoders and for the codecs it
can encode, to name a missing encoder in the error. The package remembers
both lists in the same way. A list that FFmpeg did not give is not
remembered. The section "When the build lacks an encoder" on
ffm_run says when the lists are asked for.
So the package does not see a change to your FFmpeg build until you discard the record. Examples of a change are a new FFmpeg install, a new graphics card (GPU) driver, or a different FFmpeg program. There are three ways to discard the record:
Call refresh_ffmpeg_capabilities() yourself, at any time.
Call set_program (or set_ffmpeg). It
discards the record for you, because the record describes the old
program.
Call unset_program and have it remove something. When
it forgets a saved location, the package can find a different program. A
call that removed nothing keeps the record, because the program in use
did not change. A call that removed one saved file and then failed on
another discards the record. The file it removed may have named the
program that the record came from.
The glossary in vignette("tidymedia") explains media terms such as
encoder and hardware encoder.
NULL, invisibly. Called for its side effect.
Each R process keeps its own record, and a worker does not get the record of
your session. So in a batch on W workers, each worker asks FFmpeg
once. Your session can also ask once, before the jobs start. Discarding the
record in your session does not reach the workers.
The tidymedia.hardware_encoders option works in a different way. The
package copies your value into each worker for the duration of the call, and
then puts back the worker's own value. So a batch under your setting does not
ask FFmpeg for an encoder list at all. Every worker gives the same answer as
your session.
ffmpeg_encoders and ffmpeg_codecs ask FFmpeg on
every call. So they always show the build as it is now, whether or not you
called this function.
has_hardware_encoder uses the remembered answer.
hardware_encoder gives the encoder name without asking
FFmpeg.
ffmpeg_encoders always gives a fresh encoder list.
set_program points the package at a different FFmpeg program.
Other capability functions:
ffmpeg_codecs(),
ffmpeg_encoders(),
hardware_encoder(),
has_encoder()
# After installing FFmpeg, or a GPU driver or OS update mid-session:
refresh_ffmpeg_capabilities()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.