Skip to content

Commit

Permalink
bugfix odd heights => mp4 ffmpeg complaining
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed May 15, 2019
1 parent 9673911 commit 984320d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ ${inject.body || ''}
loop: false,
autoplay: false,
rendererSettings: ${JSON.stringify(rendererSettings)},
animationData,
animationData
})
duration = animation.getDuration()
Expand Down Expand Up @@ -263,7 +263,7 @@ ${inject.body || ''}
let scale = `scale=${width}:-2`

if (width % 2 !== 0) {
if (height % 2 !== 0) {
if (height % 2 === 0) {
scale = `scale=-2:${height}`
} else {
scale = `scale=${width + 1}:-2`
Expand All @@ -286,6 +286,8 @@ ${inject.body || ''}
'-an', output
]

console.log(ffmpegArgs.join(' '))

ffmpeg = spawn(process.env.FFMPEG_PATH || 'ffmpeg', ffmpegArgs)
const { stdin, stdout, stderr } = ffmpeg

Expand Down

0 comments on commit 984320d

Please sign in to comment.