fix(ff): use fixed inputFPS instead of vfr to prevent dropped f… (#6368)

* fix(ff): use fixed inputFPS instead of vfr to prevent dropped frames
This commit is contained in:
Ben Kucera
2020-02-07 17:16:00 -05:00
committed by GitHub
parent 434d23b132
commit b5c21205d8
+10 -1
View File
@@ -167,10 +167,19 @@ module.exports = {
if (options.webmInput) {
cmd
.inputFormat('webm')
.outputOption('-vsync vfr')
// assume 18 fps. This number comes from manual measurement of avg fps coming from firefox.
// TODO: replace this with the 'vfr' option below when dropped frames issue is fixed.
.inputFPS(18)
// 'vsync vfr' (variable framerate) works perfectly but fails on top page navigation
// since video timestamp resets to 0, timestamps already written will be dropped
// .outputOption('-vsync vfr')
// this is to prevent the error "invalid data input" error
// when input frames have an odd resolution
.videoFilters(`crop='floor(in_w/2)*2:floor(in_h/2)*2'`)
// same as above but scales instead of crops
// .videoFilters("scale=trunc(iw/2)*2:trunc(ih/2)*2")
} else {