From 037a9dd112a0a45e665e0df4c4813b3f8fc09099 Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Thu, 19 Sep 2019 01:30:20 +0800 Subject: [PATCH] add ffmpeg support (#116) * add ffmpeg support * add ffmpeg support --- __tests__/utils.test.js | 5 +++++ appveyor.yml | 1 + src/helpers/utilities.js | 8 ++++++++ src/presets.js | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/__tests__/utils.test.js b/__tests__/utils.test.js index 9dc2103..d72391a 100644 --- a/__tests__/utils.test.js +++ b/__tests__/utils.test.js @@ -68,6 +68,11 @@ const cases = { 11.0.10240.17443`, version: '11.0.10240.17443', }, + ffmpeg: { + string: `ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers +built with gcc 9.1.1 (GCC) 20190807`, + version: '4.2' + }, go: { string: 'go version go1.9.3 darwin/amd64', version: '1.9.3', diff --git a/appveyor.yml b/appveyor.yml index 430cf1d..b33fed8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,6 +8,7 @@ install: test_script: - node --version - npm --version + - choco install ffmpeg - choco install r.project -version 3.6.0 - set RPATH=C:\Program Files\R\R-3.6.0\bin\x64 - set PATH=%RPATH%;%PATH% diff --git a/src/helpers/utilities.js b/src/helpers/utilities.js index 3249c6c..102162f 100644 --- a/src/helpers/utilities.js +++ b/src/helpers/utilities.js @@ -80,4 +80,12 @@ module.exports = { } return Promise.resolve(['Subversion', 'N/A']); }, + + getFFmpegInfo: () => { + utils.log('trace', 'getFFmpegInfo'); + return Promise.all([ + utils.run('ffmpeg -version').then(utils.findVersion), + utils.which('ffmpeg'), + ]).then(v => utils.determineFound('FFmpeg', v[0], v[1])); + }, }; diff --git a/src/presets.js b/src/presets.js index e418cf2..e8bae1c 100644 --- a/src/presets.js +++ b/src/presets.js @@ -15,7 +15,7 @@ module.exports = { 'RubyGems', 'Yum', ], - Utilities: ['CMake', 'Make', 'GCC', 'Git', 'Clang', 'Mercurial', 'Subversion'], + Utilities: ['CMake', 'Make', 'GCC', 'Git', 'Clang', 'Mercurial', 'Subversion', 'FFmpeg'], Servers: ['Apache', 'Nginx'], Virtualization: ['Docker', 'Parallels', 'VirtualBox', 'VMware Fusion'], SDKs: ['iOS SDK', 'Android SDK'],