start_screen_record: Start Screen Recording

Description Usage Arguments Value Note Examples

View source: R/start_screen_record.R

Description

Start Screen Recording

Usage

1
2
3
4
start_screen_record(device = guess_recording_device(),
  outfile = tempfile(fileext = ".avi"), duration = NULL, args = NULL,
  video_number = 1, audio_number = 1, overwrite = TRUE,
  audio = FALSE, video = TRUE, run = TRUE, verbose = FALSE)

Arguments

device

Device to record on

outfile

Output filename (with extension)

duration

record for a fixed duration, passed to the args, in seconds

args

additional arguments to pass to ffmpeg

video_number

number of video device

audio_number

number of audio device

overwrite

Should output file be overwritten if it exists?

audio

Should audio be captured

video

Should video be captured

run

Should the code be run (default TRUE) or simply have the arguments printed (FALSE)

verbose

print diagnostic messages

Value

A list of the process ID and output file.

Note

https://trac.ffmpeg.org/wiki/Capture/Desktop

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
res = Sys.which("ffmpeg")
stopifnot(res != "")
print(list_output_devices())
tempdir(check = TRUE)
start_screen_record(run = FALSE)
out = start_screen_record(audio = FALSE)
out
Sys.sleep(4)
out
res = end_screen_record(out)
stopifnot(file.exists(out$outfile))

out = start_screen_record(audio = TRUE, verbose = 2)
out
Sys.sleep(4)
out
res = end_screen_record(out)
stopifnot(file.exists(out$outfile))

out = start_screen_record(audio = TRUE, video = FALSE,
outfile = tempfile(fileext = ".mp3"), verbose = 2)
out
Sys.sleep(4)
out
res = end_screen_record(out)
stopifnot(file.exists(out$outfile))
mp3 = tuneR::readMP3(out$outfile)
range(mp3@left)

out = start_screen_record(audio = FALSE,
outfile = tempfile(fileext = ".gif"))
out
Sys.sleep(4)
res = end_screen_record(out)
stopifnot(file.exists(out$outfile))

muschellij2/recordscreen documentation built on May 21, 2019, 1:45 p.m.