Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/server/lib/video_capture.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,19 @@ module.exports = {
if (options.webmInput) {
cmd
.inputFormat('webm')
.outputOption('-vsync vfr')
kuceb marked this conversation as resolved.
Show resolved Hide resolved

// 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 {
Expand Down