| ffm_drawbox | R Documentation |
Add a video filter that draws a colored rectangle on the input video.
ffm_drawbox(
object,
x = 0,
y = 0,
width = "in_w",
height = "in_h",
color = "black",
thickness = "fill"
)
object |
An FFmpeg pipeline ( |
x |
The horizontal position of the left edge of the box, in pixels of
the input video. Give a nonnegative real number or a string that contains
an FFmpeg expression. The default is |
y |
The vertical position of the top edge of the box, in pixels of the
input video. Give a nonnegative real number or a string that contains an
FFmpeg expression. The default is |
width |
The width of the box, in pixels. Give a positive real number or
a string that contains an FFmpeg expression. The default is |
height |
The height of the box, in pixels. Give a positive real number
or a string that contains an FFmpeg expression. The default is
|
color |
A string with the color of the box, in FFmpeg color syntax. The
reference link below explains that syntax. With the special value
|
thickness |
The thickness of the box edge, in pixels. The value
|
object with an added instruction to apply the drawbox
filter.
https://ffmpeg.org/ffmpeg-filters.html#drawbox
https://ffmpeg.org/ffmpeg-utils.html#color-syntax
anonymize_video(), the task function that uses
ffm_drawbox() to fill regions.
Other pipeline functions:
ffm_batch(),
ffm_codec(),
ffm_compile(),
ffm_concat(),
ffm_copy(),
ffm_crop(),
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()
video <- system.file("extdata", "sample.mp4", package = "tidymedia")
# Draw a filled red box covering the top-left quarter of the frame
ffm_files(video, "output.mp4") |>
ffm_drawbox(width = "in_w/2", height = "in_h/2", color = "red") |>
ffm_compile()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.