| cgv_record_start | R Documentation |
Pipes raw RGB frames from the live canvas into ffmpeg, which
encodes them on the fly. The recording runs in the background while the
user keeps interacting with the viewer (mouse, keyboard).
cgv_record_start(
viewer,
file,
fps = 30L,
duration = NA_real_,
ffmpeg_args = NULL
)
viewer |
External pointer from |
file |
Output path; extension determines the format. |
fps |
Frames per second (default 30). |
duration |
Optional cap in seconds; |
ffmpeg_args |
Optional extra ffmpeg flags spliced before the output
path (e.g. |
Requires ffmpeg on PATH. The container/codec is chosen by the
file extension (.mp4 / .mkv / .webm / etc.).
Frames are captured at the requested fps; if the rendering loop
produces frames faster, extras are dropped.
The recording is automatically stopped when the viewer is closed,
cgv_record_stop() is called, or the optional duration
elapses.
No return value, called for side effects: stores the recording
parameters on the viewer; the ffmpeg pipe is opened lazily on the
first rendered frame. Returns NULL invisibly.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.