diff --git a/README.md b/README.md index d92a9f7..dd0c5e6 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/lib/video/ffargs.js b/lib/video/ffargs.js index 82a4c6c..97cc982 100644 --- a/lib/video/ffargs.js +++ b/lib/video/ffargs.js @@ -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')