| ari_stitch | R Documentation | 
Given a vector of paths to images (preferably .jpgs
or .pngs) and a flat list of Waves of equal
length this function will create an .mp4 video file where each image
is shown with its corresponding audio. Take a look at the
readWave function if you want to import your audio
files into R. Please be sure that all images have the same dimensions.
ari_stitch(
  images,
  audio,
  output = tempfile(fileext = ".mp4"),
  verbose = FALSE,
  cleanup = TRUE,
  ffmpeg_opts = "",
  divisible_height = TRUE,
  audio_codec = get_audio_codec(),
  video_codec = get_video_codec(),
  video_sync_method = "2",
  audio_bitrate = NULL,
  video_bitrate = NULL,
  pixel_format = "yuv420p",
  fast_start = FALSE,
  deinterlace = FALSE,
  stereo_audio = TRUE,
  duration = NULL,
  video_filters = NULL,
  frames_per_second = NULL,
  check_inputs = TRUE
)
images | 
 A vector of paths to images.  | 
audio | 
 A list of   | 
output | 
 A path to the video file which will be created.  | 
verbose | 
 print diagnostic messages. If > 1, then more are printed  | 
cleanup | 
 If   | 
ffmpeg_opts | 
 additional options to send to   | 
divisible_height | 
 Make height divisible by 2, which may be required if getting "height not divisible by 2" error.  | 
audio_codec | 
 The audio encoder for the splicing.  If this
fails, try   | 
video_codec | 
 The video encoder for the splicing.  If this
fails, see   | 
video_sync_method | 
 Video sync method. Should be "auto" or '"vfr"' or a numeric. See https://ffmpeg.org/ffmpeg.html.  | 
audio_bitrate | 
 Bit rate for audio. Passed to   | 
video_bitrate | 
 Bit rate for video. Passed to   | 
pixel_format | 
 pixel format to encode for 'ffmpeg'.  | 
fast_start | 
 Adding 'faststart' flags for YouTube and other sites, see https://trac.ffmpeg.org/wiki/Encode/YouTube  | 
deinterlace | 
 should the video be de-interlaced, see https://ffmpeg.org/ffmpeg-filters.html, generally for YouTube  | 
stereo_audio | 
 should the audio be forced to stereo, corresponds to '-ac 2'  | 
duration | 
 a vector of numeric durations for each audio
track.  See   | 
video_filters | 
 any options that are passed to   | 
frames_per_second | 
 frames per second of the video, should be an integer  | 
check_inputs | 
 Should the inputs be checked?  Almost always should
be   | 
This function uses FFmpeg
which you should be sure is installed before using this function. If running
Sys.which("ffmpeg") in your R console returns an empty string after
installing FFmpeg then you should set the path to FFmpeg on you computer to
an environmental variable using Sys.setenv(ffmpeg = "path/to/ffmpeg").
The environmental variable will always override the result of
Sys.which("ffmpeg").
A logical value, with the attribute outfile for the
output file.
## Not run: 
if (ffmpeg_version_sufficient()) {
  result <- ari_stitch(
    ari_example(c("mab1.png", "mab2.png")),
    list(tuneR::noise(), tuneR::noise())
  )
  result <- ari_stitch(
    ari_example(c("mab1.png", "mab2.png")),
    list(tuneR::noise(), tuneR::noise()),
    ffmpeg_opts = "-qscale 0",
    verbose = 2
  )
  # system2("open", attributes(result)$outfile)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.