has_encoder: Ask whether your FFmpeg build has an encoder

View source: R/ffmpeg.R

has_encoderR Documentation

Ask whether your FFmpeg build has an encoder

Description

FFmpeg builds differ in the encoders they were compiled with. A build without libx264 refuses every call that names it, and some Linux distributions ship exactly that build, because x264 is not free software. This function answers whether one encoder is in the build this package resolves. You can then name another encoder, or skip the work, before you run anything.

Usage

has_encoder(name)

Arguments

name

A string naming one encoder, spelled as ffmpeg_encoders spells it, such as "libx264", "aac" or "libmp3lame".

Details

The answer comes from the list ffmpeg_encoders returns. The list is asked of FFmpeg once per session and then remembered, so a repeated call does not start FFmpeg again. refresh_ffmpeg_capabilities makes the next call ask again.

The tidymedia.hardware_encoders option does not change this answer. That option names the hardware encoders of the machine, and this question is about the whole build. Use has_hardware_encoder for the GPU backends.

Where the package finds no FFmpeg at all, the answer is FALSE: nothing can be encoded, so no encoder is available. A location you saved with set_ffmpeg that no longer works still gives its warning beside the FALSE. So a machine you can repair is never reported silently as a build without the encoder.

Value

A single TRUE or FALSE.

See Also

ffmpeg_encoders for the whole list, has_hardware_encoder for the GPU backends, and refresh_ffmpeg_capabilities to make the next call ask FFmpeg again.

Other capability functions: ffmpeg_codecs(), ffmpeg_encoders(), hardware_encoder(), refresh_ffmpeg_capabilities()

Examples


has_encoder("libx264")
has_encoder("no_such_encoder")


tidymedia documentation built on Oct. 11, 2026, 5:08 p.m.