ropensci / av

Working with Video in R
https://docs.ropensci.org/av
Other
92 stars 10 forks source link

Error in the first example. #8

Open JiaxiangBU opened 5 years ago

JiaxiangBU commented 5 years ago

Here is the error message.

Error in transform_path(all_frames, next_state, ease, params$transition_length[i], : transformr is required to tween paths and lines

I find the cause of this bug is the function transition_states from gganimate. However, I don;t use av and gganimate package before and don't know how to go deeper.

I run this code and fail both on Mac and on Win. Here are my error message and session information.

# Get latest gganimate
# devtools::install_github("thomasp85/gganimate")
library(gganimate)
#> 载入需要的程辑包:ggplot2

# Define the "renderer" for gganimate
av_renderer <- function(vfilter = "null", filename = 'output.mp4'){
  function(frames, fps){
    unlink(filename)
    av::av_encode_video(frames, filename, framerate = fps, vfilter = vfilter)
  }
}

# Create the gganimate plot
p <- ggplot(airquality, aes(Day, Temp)) + 
  geom_line(size = 2, colour = 'steelblue') + 
  transition_states(Month, 4, 1) + 
  shadow_mark(size = 1, colour = 'grey')

# Render and show the video
q <- 2
df <- animate(p, renderer = av_renderer(), width = 720*q, height = 480*q, res = 72*q, fps = 25)
#> Error in transform_path(all_frames, next_state, ease, params$transition_length[i], : transformr is required to tween paths and lines
utils::browseURL('output.mp4')

Created on 2018-10-30 by the reprex package (v0.2.0).

Session info ``` r devtools::session_info() #> Session info ------------------------------------------------------------- #> setting value #> version R version 3.5.1 (2018-07-02) #> system x86_64, darwin15.6.0 #> ui X11 #> language (EN) #> collate zh_CN.UTF-8 #> tz Asia/Shanghai #> date 2018-10-30 #> Packages ----------------------------------------------------------------- #> package * version date source #> assertthat 0.2.0 2017-04-11 CRAN (R 3.5.0) #> backports 1.1.2 2017-12-13 CRAN (R 3.5.0) #> base * 3.5.1 2018-07-05 local #> bindr 0.1.1 2018-03-13 CRAN (R 3.5.0) #> bindrcpp 0.2.2 2018-03-29 CRAN (R 3.5.0) #> colorspace 1.3-2 2016-12-14 CRAN (R 3.5.0) #> compiler 3.5.1 2018-07-05 local #> crayon 1.3.4 2017-09-16 CRAN (R 3.5.0) #> datasets * 3.5.1 2018-07-05 local #> devtools 1.13.6 2018-06-27 CRAN (R 3.5.0) #> digest 0.6.16 2018-08-22 cran (@0.6.16) #> dplyr 0.7.6 2018-06-29 CRAN (R 3.5.1) #> evaluate 0.11 2018-07-17 CRAN (R 3.5.0) #> farver 1.0 2018-09-17 CRAN (R 3.5.0) #> gganimate * 0.9.9.9999 2018-10-30 local #> ggplot2 * 3.0.0 2018-07-03 CRAN (R 3.5.0) #> gifski 0.8.6 2018-09-28 CRAN (R 3.5.0) #> glue 1.3.0 2018-07-17 CRAN (R 3.5.0) #> graphics * 3.5.1 2018-07-05 local #> grDevices * 3.5.1 2018-07-05 local #> grid 3.5.1 2018-07-05 local #> gtable 0.2.0 2016-02-26 CRAN (R 3.5.0) #> hms 0.4.2 2018-03-10 CRAN (R 3.5.0) #> htmltools 0.3.6 2017-04-28 CRAN (R 3.5.0) #> knitr 1.20 2018-02-20 CRAN (R 3.5.0) #> labeling 0.3 2014-08-23 CRAN (R 3.5.0) #> lazyeval 0.2.1 2017-10-29 CRAN (R 3.5.0) #> magrittr 1.5 2014-11-22 CRAN (R 3.5.0) #> memoise 1.1.0 2017-04-21 CRAN (R 3.5.0) #> methods * 3.5.1 2018-07-05 local #> munsell 0.5.0 2018-06-12 CRAN (R 3.5.0) #> pillar 1.3.0 2018-07-14 CRAN (R 3.5.0) #> pkgconfig 2.0.1 2017-03-21 CRAN (R 3.5.0) #> plyr 1.8.4 2016-06-08 CRAN (R 3.5.0) #> png 0.1-7 2013-12-03 CRAN (R 3.5.0) #> prettyunits 1.0.2 2015-07-13 CRAN (R 3.5.0) #> progress 1.2.0 2018-06-14 CRAN (R 3.5.0) #> purrr 0.2.5 2018-05-29 CRAN (R 3.5.0) #> R6 2.3.0 2018-10-04 cran (@2.3.0) #> Rcpp 0.12.19 2018-10-01 cran (@0.12.19) #> rlang 0.2.2 2018-08-16 cran (@0.2.2) #> rmarkdown 1.10 2018-06-11 CRAN (R 3.5.0) #> rprojroot 1.3-2 2018-01-03 CRAN (R 3.5.0) #> scales 0.5.0 2017-08-24 CRAN (R 3.5.0) #> stats * 3.5.1 2018-07-05 local #> stringi 1.2.4 2018-07-20 CRAN (R 3.5.0) #> stringr 1.3.1 2018-05-10 CRAN (R 3.5.0) #> tibble 1.4.2 2018-01-22 CRAN (R 3.5.0) #> tidyselect 0.2.5 2018-10-11 cran (@0.2.5) #> tools 3.5.1 2018-07-05 local #> tweenr 1.0.0 2018-09-27 CRAN (R 3.5.0) #> utils * 3.5.1 2018-07-05 local #> withr 2.1.2 2018-03-15 CRAN (R 3.5.0) #> yaml 2.2.0 2018-07-25 CRAN (R 3.5.0) ```
# Get latest gganimate
# devtools::install_github("thomasp85/gganimate")
library(gganimate)
#> 载入需要的程辑包:ggplot2

# Define the "renderer" for gganimate
av_renderer <- function(vfilter = "null", filename = 'output.mp4'){
  function(frames, fps){
    unlink(filename)
    av::av_encode_video(frames, filename, framerate = fps, vfilter = vfilter)
  }
}

# Create the gganimate plot
p <- ggplot(airquality, aes(Day, Temp)) + 
  geom_line(size = 2, colour = 'steelblue') + 
  transition_states(Month, 4, 1) + 
  shadow_mark(size = 1, colour = 'grey')

# Render and show the video
q <- 2
df <- animate(p, renderer = av_renderer(), width = 720*q, height = 480*q, res = 72*q, fps = 25)
#> Error in transform_path(all_frames, next_state, ease, params$transition_length[i], : transformr is required to tween paths and lines
utils::browseURL('output.mp4')

Created on 2018-10-30 by the reprex package (v0.2.1)

Session info ``` r devtools::session_info() #> Session info ------------------------------------------------------------- #> setting value #> version R version 3.4.4 (2018-03-15) #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate Chinese (Simplified)_People's Republic of China.936 #> tz Asia/Taipei #> date 2018-10-30 #> Packages ----------------------------------------------------------------- #> package * version date source #> assertthat 0.2.0 2017-04-11 CRAN (R 3.4.3) #> backports 1.1.2 2017-12-13 CRAN (R 3.4.3) #> base * 3.4.4 2018-03-15 local #> bindr 0.1.1 2018-03-13 CRAN (R 3.4.4) #> bindrcpp 0.2.2 2018-03-29 CRAN (R 3.4.4) #> colorspace 1.3-2 2016-12-14 CRAN (R 3.4.3) #> compiler 3.4.4 2018-03-15 local #> crayon 1.3.4 2017-09-16 CRAN (R 3.4.3) #> datasets * 3.4.4 2018-03-15 local #> devtools 1.13.5 2018-02-18 CRAN (R 3.4.3) #> digest 0.6.18 2018-10-10 CRAN (R 3.4.4) #> dplyr 0.7.7 2018-10-16 CRAN (R 3.4.4) #> evaluate 0.10.1 2017-06-24 CRAN (R 3.4.3) #> farver 1.0 2018-09-17 CRAN (R 3.4.4) #> gganimate * 0.9.9.9999 2018-10-30 Github (thomasp85/gganimate@cc23618) #> ggplot2 * 3.1.0 2018-10-30 Github (tidyverse/ggplot2@0e29a19) #> gifski 0.8.6 2018-09-28 CRAN (R 3.4.4) #> glue 1.3.0 2018-07-17 CRAN (R 3.4.4) #> graphics * 3.4.4 2018-03-15 local #> grDevices * 3.4.4 2018-03-15 local #> grid 3.4.4 2018-03-15 local #> gtable 0.2.0 2016-02-26 CRAN (R 3.4.3) #> hms 0.4.2 2018-03-10 CRAN (R 3.4.4) #> htmltools 0.3.6 2017-04-28 CRAN (R 3.4.3) #> knitr 1.20 2018-02-20 CRAN (R 3.4.3) #> labeling 0.3 2014-08-23 CRAN (R 3.4.1) #> lazyeval 0.2.1 2017-10-29 CRAN (R 3.4.3) #> magrittr 1.5 2014-11-22 CRAN (R 3.4.3) #> memoise 1.1.0 2017-04-21 CRAN (R 3.4.4) #> methods * 3.4.4 2018-03-15 local #> munsell 0.5.0 2018-06-12 CRAN (R 3.4.4) #> pillar 1.3.0.9000 2018-07-30 Github (r-lib/pillar@7582a75) #> pkgconfig 2.0.1 2017-03-21 CRAN (R 3.4.3) #> plyr 1.8.4 2016-06-08 CRAN (R 3.4.3) #> png 0.1-7 2013-12-03 CRAN (R 3.4.1) #> prettyunits 1.0.2 2015-07-13 CRAN (R 3.4.4) #> progress 1.2.0 2018-06-14 CRAN (R 3.4.4) #> purrr 0.2.5 2018-05-29 CRAN (R 3.4.4) #> R6 2.3.0 2018-10-04 CRAN (R 3.4.4) #> Rcpp 0.12.18 2018-07-23 CRAN (R 3.4.4) #> rlang 0.3.0.1 2018-10-25 CRAN (R 3.4.4) #> rmarkdown 1.10 2018-06-11 CRAN (R 3.4.4) #> rprojroot 1.3-2 2018-01-03 CRAN (R 3.4.3) #> scales 1.0.0 2018-08-09 CRAN (R 3.4.4) #> stats * 3.4.4 2018-03-15 local #> stringi 1.1.7 2018-03-12 CRAN (R 3.4.4) #> stringr 1.3.1 2018-05-10 CRAN (R 3.4.4) #> tibble 1.4.2 2018-01-22 CRAN (R 3.4.3) #> tidyselect 0.2.4 2018-02-26 CRAN (R 3.4.3) #> tools 3.4.4 2018-03-15 local #> tweenr 1.0.0 2018-09-27 CRAN (R 3.4.4) #> utils * 3.4.4 2018-03-15 local #> withr 2.1.2 2018-03-15 CRAN (R 3.4.4) #> yaml 2.2.0 2018-07-25 CRAN (R 3.4.4) ```
FredrikKarlssonSpeech commented 1 year ago

Anyone working on an implmentation of av_renderer? Why was it removed?

jeroen commented 1 year ago

It is in the gganimate package.

Op vr 26 mei 2023 15:49 schreef Fredrik Karlsson @.***>:

Anyone working on an implmentation of av_renderer? Why was it removed?

— Reply to this email directly, view it on GitHub https://github.com/ropensci/av/issues/8#issuecomment-1564424021, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABUZ76ZG52YXFE3KA7KMBDXICYFRANCNFSM4GAEYCVA . You are receiving this because you are subscribed to this thread.Message ID: @.***>