Set the audio codec, the video codec, or both, for the output file. Use
ffmpeg_codecs() to see a list of the codecs in your FFmpeg version.
The glossary in vignette("tidymedia") explains media terms such as
codec and stream copy.
Arguments
- object
An FFmpeg pipeline (
ffm) object created byffm_files().- audio
A string that names the audio codec, or
NULLto set only the video codec. The default isNULL. Seeaudio_streamfor the two things that the nameaudiomeans in the pipeline functions, and for the input indexaudio_input.- video
A string that names the video codec, or
NULLto set only the audio codec. The default isNULL.
See also
ffm_copy(), the shortcut for stream copy, ffmpeg_codecs() to
list the codecs you can use, and standardize_video(), a task function
built on it.
Other pipeline functions:
ffm_batch(),
ffm_compile(),
ffm_concat(),
ffm_copy(),
ffm_crop(),
ffm_drawbox(),
ffm_drop(),
ffm_files(),
ffm_fps(),
ffm_hstack(),
ffm_jobs(),
ffm_loudnorm(),
ffm_map(),
ffm_output_options(),
ffm_overlay(),
ffm_pixel_format(),
ffm_run(),
ffm_scale(),
ffm_seek(),
ffm_trim(),
ffm_vstack(),
print.tidymedia_ffm()
Examples
video <- system.file("extdata", "sample.mp4", package = "tidymedia")
ffm_files(video, "output.mp4") |>
ffm_codec(video = "libx264", audio = "aac") |>
ffm_compile()
#> [1] "-y -i \"/home/runner/work/_temp/Library/tidymedia/extdata/sample.mp4\" -codec:v libx264 -codec:a aac \"output.mp4\""