diff --git a/.gitignore b/.gitignore index da5b574..ed091d7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .Rproj.user .RData .DS_Store -smoke_test/* \ No newline at end of file +smoke_test/* +inst/doc diff --git a/.travis.yml b/.travis.yml index 337c108..1869be8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,12 +4,13 @@ matrix: - r: release - r: oldrel - r: devel -dist: trusty +dist: xenial sudo: required + before_install: - sudo apt-get -qq update - sudo apt-get install -y software-properties-common - - sudo add-apt-repository -y ppa:mc3man/trusty-media + - sudo add-apt-repository -y ppa:jonathonf/ffmpeg-4 - sudo apt-get -qq update - sudo apt-get install -y ffmpeg --allow-unauthenticated diff --git a/CRAN-RELEASE b/CRAN-RELEASE deleted file mode 100644 index b27f0b6..0000000 --- a/CRAN-RELEASE +++ /dev/null @@ -1,2 +0,0 @@ -This package was submitted to CRAN on 2019-07-01. -Once it is accepted, delete this file and tag the release (commit 0585b6e6d5). diff --git a/DESCRIPTION b/DESCRIPTION index 83741e3..707de5d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ari Type: Package Title: Automated R Instructor -Version: 0.3.2 +Version: 0.3.3 Authors@R: c( person("Sean", "Kross", email = "sean@seankross.com", role = c("aut", "cre")), person("John", "Muschelli", role = "ctb") @@ -31,10 +31,12 @@ Suggests: grDevices, xaringan, aws.signature, - aws.polly + aws.polly, + knitr License: MIT + file LICENSE URL: http://github.com/seankross/ari BugReports: http://github.com/seankross/ari/issues Encoding: UTF-8 LazyData: true RoxygenNote: 6.1.1 +VignetteBuilder: knitr diff --git a/NEWS.md b/NEWS.md index 122769c..7b1dda5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# ari 0.3.3 + +- Added vignette for using via a Docker image. + # ari 0.3.2 - Fixed bug in `ffmpeg_version_sufficient` if `ffmpeg` is a development version. diff --git a/R/ari_stitch.R b/R/ari_stitch.R index 522860d..3fde03c 100644 --- a/R/ari_stitch.R +++ b/R/ari_stitch.R @@ -47,10 +47,12 @@ #' @importFrom tuneR bind writeWave #' @export #' @examples +#' \dontrun{ #' if (ffmpeg_version_sufficient()) { #' result = ari_stitch( #' ari_example(c("mab1.png", "mab2.png")), #' list(tuneR::noise(), tuneR::noise())) +#' } #' } ari_stitch <- function( images, audio, @@ -61,7 +63,7 @@ ari_stitch <- function( divisible_height = TRUE, audio_codec = get_audio_codec(), video_codec = get_video_codec(), - video_sync_method = "-1", + video_sync_method = "2", audio_bitrate = NULL, video_bitrate = NULL, pixel_format = "yuv420p", @@ -79,7 +81,15 @@ ari_stitch <- function( dir.exists(output_dir) ) if (is.character(audio)) { - audio = lapply(audio, tuneR::readMP3) + + audio = lapply(audio, function(x) { + ext = tolower(tools::file_ext(x)) + func = switch(ext, + wav = tuneR::readWave, + mp3 = tuneR::readMP3, + tuneR::readMP3) + func(x) + }) audio = lapply(audio, function(wav) { ideal_duration <- ceiling(length(wav@left) / wav@samp.rate) left = rep(0, diff --git a/R/ffmpeg_codecs.R b/R/ffmpeg_codecs.R index 16ce58c..e8b58d0 100644 --- a/R/ffmpeg_codecs.R +++ b/R/ffmpeg_codecs.R @@ -4,11 +4,13 @@ #' @export #' #' @examples +#' \dontrun{ #' if (ffmpeg_version_sufficient()) { #' ffmpeg_codecs() #' ffmpeg_video_codecs() #' ffmpeg_audio_codecs() #' } +#' } ffmpeg_codecs = function() { ffmpeg = ffmpeg_exec(quote = TRUE) cmd = paste(ffmpeg, "-codecs") diff --git a/R/ffmpeg_exec.R b/R/ffmpeg_exec.R index d083ef9..4049ee0 100644 --- a/R/ffmpeg_exec.R +++ b/R/ffmpeg_exec.R @@ -8,9 +8,11 @@ #' @export #' #' @examples +#' \dontrun{ #' if (have_ffmpeg_exec()) { #' ffmpeg_exec() #' } +#' } ffmpeg_exec = function(quote = FALSE) { ffmpeg <- discard(c(Sys.getenv("ffmpeg"), Sys.which("ffmpeg")), ~ nchar(.x) == 0)[1] diff --git a/R/set_encoders.R b/R/set_encoders.R index 1079646..0fb72a3 100644 --- a/R/set_encoders.R +++ b/R/set_encoders.R @@ -17,7 +17,7 @@ get_os = function() { #' @export #' #' @examples -#' +#' \dontrun{ #' if (have_ffmpeg_exec()) { #' print(ffmpeg_version()) #' get_audio_codec() @@ -39,7 +39,7 @@ get_os = function() { #' #' audio_codec_encode("aac") #' } -#' +#' } set_audio_codec = function(codec) { if (missing(codec)) { os = get_os() diff --git a/cran-comments.md b/cran-comments.md index 5cd4f95..432fff0 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,14 +1,11 @@ ## Test environments -* local OS X install, R 3.6.1 -* ubuntu 14.04 (on travis-ci), R 3.6.1 +* local OS X install, R 3.6.2 +* ubuntu 16.04 (on travis-ci), R 3.6.2 * win-builder (devel and release) +* R-hub windows-x86_64-devel (r-devel) +* R-hub ubuntu-gcc-release (r-release) +* R-hub fedora-clang-devel (r-devel) ## R CMD check results -0 errors | 0 warnings | 1 note - -* This is a new release. - -## Release Summary - -Third release of `ari`. \ No newline at end of file +0 errors | 0 warnings | 0 notes \ No newline at end of file diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 46d000f..1774646 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -60,7 +60,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/docs/authors.html b/docs/authors.html index 639cf3f..678928d 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -60,7 +60,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/docs/index.html b/docs/index.html index 2c7d910..9c92504 100644 --- a/docs/index.html +++ b/docs/index.html @@ -35,7 +35,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/docs/news/index.html b/docs/news/index.html index 8034ff4..a505048 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -60,7 +60,7 @@ ari - 0.3.0 + 0.3.2 @@ -103,6 +103,16 @@

Changelog

Source: NEWS.md +
+

+ari 0.3.2 2019-08-19 +

+ +

ari 0.3.0 Unreleased @@ -146,6 +156,7 @@

Contents

diff --git a/docs/reference/ari_example.html b/docs/reference/ari_example.html index e2e0e9e..3d95d38 100644 --- a/docs/reference/ari_example.html +++ b/docs/reference/ari_example.html @@ -64,7 +64,7 @@ ari - 0.3.0 + 0.3.2

diff --git a/docs/reference/ari_narrate.html b/docs/reference/ari_narrate.html index 5e48cb0..f05e967 100644 --- a/docs/reference/ari_narrate.html +++ b/docs/reference/ari_narrate.html @@ -66,7 +66,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/docs/reference/ari_spin.html b/docs/reference/ari_spin.html index 186c794..25e1c16 100644 --- a/docs/reference/ari_spin.html +++ b/docs/reference/ari_spin.html @@ -71,7 +71,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/docs/reference/ari_stitch.html b/docs/reference/ari_stitch.html index 6a13b6d..49de891 100644 --- a/docs/reference/ari_stitch.html +++ b/docs/reference/ari_stitch.html @@ -68,7 +68,7 @@ ari - 0.3.0 + 0.3.2 @@ -125,9 +125,11 @@

Create a video from images and audio

ari_stitch(images, audio, output = tempfile(fileext = ".mp4"),
   verbose = FALSE, cleanup = TRUE, ffmpeg_opts = "",
-  divisible_height = FALSE, audio_codec = get_audio_codec(),
-  video_codec = get_video_codec(), audio_bitrate = "192k",
-  video_bitrate = NULL)
+ divisible_height = TRUE, audio_codec = get_audio_codec(), + video_codec = get_video_codec(), video_sync_method = "-1", + audio_bitrate = NULL, video_bitrate = NULL, + pixel_format = "yuv420p", fast_start = TRUE, deinterlace = TRUE, + stereo_audio = TRUE)

Arguments

@@ -171,6 +173,11 @@

Arg

+ + + + @@ -180,6 +187,26 @@

Arg

+ + + + + + + + + + + + + + + +
video_codec

The video encoder for the splicing. If this fails, see ffmpeg -codecs

video_sync_method

Video sync method. Should be +"auto" or `"vfr"` or a numeric. See https://ffmpeg.org/ffmpeg.html.

audio_bitratevideo_bitrate

Bit rate for video. Passed to -b:v.

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`

Value

diff --git a/docs/reference/ari_talk.html b/docs/reference/ari_talk.html index 397d0c6..6770d75 100644 --- a/docs/reference/ari_talk.html +++ b/docs/reference/ari_talk.html @@ -63,7 +63,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/docs/reference/codecs.html b/docs/reference/codecs.html index 2d92f61..6902fe3 100644 --- a/docs/reference/codecs.html +++ b/docs/reference/codecs.html @@ -63,7 +63,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/docs/reference/ffmpeg_codecs.html b/docs/reference/ffmpeg_codecs.html index dc33e06..270ab50 100644 --- a/docs/reference/ffmpeg_codecs.html +++ b/docs/reference/ffmpeg_codecs.html @@ -63,7 +63,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/docs/reference/ffmpeg_exec.html b/docs/reference/ffmpeg_exec.html index 55b8548..fd7b0c9 100644 --- a/docs/reference/ffmpeg_exec.html +++ b/docs/reference/ffmpeg_exec.html @@ -63,7 +63,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/docs/reference/index.html b/docs/reference/index.html index 65b4c01..6b8b49d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -60,7 +60,7 @@ ari - 0.3.0 + 0.3.2 diff --git a/man/ari_stitch.Rd b/man/ari_stitch.Rd index dee8870..f67078d 100644 --- a/man/ari_stitch.Rd +++ b/man/ari_stitch.Rd @@ -7,7 +7,7 @@ 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 = "-1", + video_codec = get_video_codec(), video_sync_method = "2", audio_bitrate = NULL, video_bitrate = NULL, pixel_format = "yuv420p", fast_start = TRUE, deinterlace = TRUE, stereo_audio = TRUE) @@ -76,9 +76,11 @@ The environmental variable will always override the result of \code{Sys.which("ffmpeg")}. } \examples{ +\dontrun{ if (ffmpeg_version_sufficient()) { result = ari_stitch( ari_example(c("mab1.png", "mab2.png")), list(tuneR::noise(), tuneR::noise())) +} } } diff --git a/man/codecs.Rd b/man/codecs.Rd index af27498..0384a3e 100644 --- a/man/codecs.Rd +++ b/man/codecs.Rd @@ -33,7 +33,7 @@ A `NULL` output Set Default Audio and Video Codecs } \examples{ - +\dontrun{ if (have_ffmpeg_exec()) { print(ffmpeg_version()) get_audio_codec() @@ -55,7 +55,7 @@ video_codec_encode("libx264") audio_codec_encode("aac") } - +} } \seealso{ [ffmpeg_codecs()] for options diff --git a/man/ffmpeg_codecs.Rd b/man/ffmpeg_codecs.Rd index 69b7d55..f7b63a2 100644 --- a/man/ffmpeg_codecs.Rd +++ b/man/ffmpeg_codecs.Rd @@ -31,9 +31,11 @@ A `data.frame` of codec names and capabilities Get Codecs for ffmpeg } \examples{ +\dontrun{ if (ffmpeg_version_sufficient()) { ffmpeg_codecs() ffmpeg_video_codecs() ffmpeg_audio_codecs() } } +} diff --git a/man/ffmpeg_exec.Rd b/man/ffmpeg_exec.Rd index 5687ce3..d297447 100644 --- a/man/ffmpeg_exec.Rd +++ b/man/ffmpeg_exec.Rd @@ -24,7 +24,9 @@ to find `ffmpeg`. If `ffmpeg` is not in your PATH, then please set the path to `ffmpeg` using `Sys.setenv(ffmpeg = "/path/to/ffmpeg")` } \examples{ +\dontrun{ if (have_ffmpeg_exec()) { ffmpeg_exec() } } +} diff --git a/vignettes/.gitignore b/vignettes/.gitignore new file mode 100644 index 0000000..097b241 --- /dev/null +++ b/vignettes/.gitignore @@ -0,0 +1,2 @@ +*.html +*.R diff --git a/vignettes/Simple-Ari-Configuration-with-Docker.Rmd b/vignettes/Simple-Ari-Configuration-with-Docker.Rmd new file mode 100644 index 0000000..34cdb09 --- /dev/null +++ b/vignettes/Simple-Ari-Configuration-with-Docker.Rmd @@ -0,0 +1,62 @@ +--- +title: "Simple Ari Configuration with Docker" +author: "Sean Kross" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Simple-Ari-Configuration-with-Docker} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>" +) +``` + +Behind the scenes, Ari makes extensive use of FFmpeg, a tool and a collection +of open source software for editing audio and video files. Managing your +computer's configuration of FFmpeg can be challenging, so we have provided a +Docker container to help you quickly get started making videos with Ari. This +guide will help you install Docker and retrieve the Docker image we have +prepared. This Docker image will launch an RStudio session in your web browser +with all of Ari's dependencies already configured. + +## Installing Docker + +If you do not have Docker installed already, download and install Docker +Desktop for [Windows](https://docs.docker.com/docker-for-windows/install/) or +[Mac](https://docs.docker.com/docker-for-mac/install/), or download the Docker +command line interface for your [Linux distribution](https://docs.docker.com/install/). +After you have installed Docker, open PowerShell on Windows or Terminal on Mac +or Linux. + +## Starting ari-on-docker + +No matter which command line interface you are using, run the following command +to download the ari-on-docker image: + +```{bash, eval=FALSE} +docker pull seankross/ari-on-docker +``` + +Once the image is finished downloading, run the following command to start +RStudio in the browser: + +```{bash, eval=FALSE} +docker run -dp 8787:8787 -e PASSWORD=ari -e ROOT=TRUE seankross/ari-on-docker +``` + +After executing this command, navigate to `http://localhost:8787/` in your web +browser. The RStudio login screen should appear: use username `admin` and +password `ari` to get access to RStudio. All of Ari's +dependencies should be configured, so you can get started making videos. + +## Further Details + +If you are interested in how the ari-on-docker image is built, it is currently +being developed here: https://github.com/seankross/ari-on-docker. Looking at +the `Dockerfile` in this repository may also help you configure FFmpeg for Ari +on your own computer.