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 @@
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 @@ 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 @@ 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 @@ @@ -103,6 +103,16 @@NEWS.md
+ ffmpeg_version_sufficient
if ffmpeg
is a development version.ari_spin
for voice and such.ffmpeg_version
for versions with a +
for CRAN.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)
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 | @@ -180,6 +187,26 @@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` |
+