diff --git a/lib/index.js b/lib/index.js index 4da9fc3..a1d71a6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -17,6 +17,7 @@ module.exports = async (opts) => { cleanupFrames = true, transition = undefined, transitions = undefined, + audio = undefined, videos, output } = opts @@ -58,6 +59,7 @@ module.exports = async (opts) => { log, framePattern, frameFormat, + audio, output, theme, onProgress: (p) => { diff --git a/lib/transcode-video.js b/lib/transcode-video.js index a9431f4..7d88c4c 100644 --- a/lib/transcode-video.js +++ b/lib/transcode-video.js @@ -6,7 +6,7 @@ const onTranscodeProgress = require('ffmpeg-on-progress') module.exports = async (opts) => { const { log, - audioPath, + audio, frameFormat, framePattern, onProgress, @@ -30,8 +30,8 @@ module.exports = async (opts) => { const cmd = ffmpeg(framePattern) .inputOptions(inputOptions) - if (audioPath) { - cmd.addInput(audioPath) + if (audio) { + cmd.addInput(audio) } const outputOptions = [] @@ -54,7 +54,7 @@ module.exports = async (opts) => { ]) // audio - .concat(!audioPath ? [ ] : [ + .concat(!audio ? [ ] : [ '-c:a', 'copy', '-shortest' ]) diff --git a/readme.md b/readme.md index 77b5676..94e7315 100644 --- a/readme.md +++ b/readme.md @@ -174,6 +174,13 @@ const transitions = [ ] ``` +##### audio + +Type: `String` +**Required** + +Path or URL to an audio file to use as the audio track for the output video. + ##### frameFormat Type: `string`