Skip to content

Commit

Permalink
feat: video framerate option
Browse files Browse the repository at this point in the history
  • Loading branch information
Holayn authored and rprieto committed Sep 8, 2022
1 parent 8f790d0 commit 7da47f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ The default value is `none`
opts = { video-hwaccel: 'vaapi' }
```

##### Video FPS

The default export video FPS is 25. You can specify an explicit FPS by adding a `framerate` option:

```js
opts = { framerate: 60 }
opts = { framerate: 'preserve' } // preserve the original source video's FPS
```

##### Conversion progress

The `.video()` call returns an [EventEmitter](https://nodejs.org/api/events.html)
Expand Down
4 changes: 3 additions & 1 deletion lib/video/ffargs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ exports.prepare = function (source, target, options) {
args.push('-i', source)

// output framerate
args.push('-r', DEFAULT_VIDEO_FPS)
if (options.framerate !== 'preserve') {
args.push('-r', options.framerate || DEFAULT_VIDEO_FPS)
}

// misc options
args.push('-vsync', '2', '-movflags', '+faststart')
Expand Down

0 comments on commit 7da47f3

Please sign in to comment.