jhudsl / ari

:dancers: The Automated R Instructor
https://jhudatascience.org/ari/
Other
146 stars 38 forks source link

Ffmpeg error with divisibility #9

Open muschellij2 opened 6 years ago

muschellij2 commented 6 years ago

Running

library(ari)
library(aws.polly)

aws.signature::use_credentials(profile = "polly")

files = list.files(pattern = ".png$",
                   full.names = TRUE)
files = path.expand(files)
para = readLines("script.txt")
para = para[ !para %in% ""]
ari_spin(paragraphs = para,
         images = files, output = "joey.mp4",
         voice = "Joey")

and getting

[libx264 @ 0x7fe0e2811600] height not divisible by 2 (3000x1687)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

and it seems like you can add -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" to ffmpeg as per https://stackoverflow.com/questions/20847674/ffmpeg-libx264-height-not-divisible-by-2/29582287

img00 img01 script.txt