aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/ffmpeg-utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-06 16:39:17 +0200
committerChocobozzz <me@florianbigard.com>2021-05-06 16:39:17 +0200
commit60f1f61579947caab1b1d23646cd4e82691b431c (patch)
tree508535415e092dc8ba3608237169a7cac50955e5 /server/helpers/ffmpeg-utils.ts
parent16de9ff46dd3b737ef90d50f7e603ec682b362cf (diff)
downloadPeerTube-60f1f61579947caab1b1d23646cd4e82691b431c.tar.gz
PeerTube-60f1f61579947caab1b1d23646cd4e82691b431c.tar.zst
PeerTube-60f1f61579947caab1b1d23646cd4e82691b431c.zip
Fix ffmpeg version checker
Diffstat (limited to 'server/helpers/ffmpeg-utils.ts')
-rw-r--r--server/helpers/ffmpeg-utils.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts
index 75297df8f..f79b70469 100644
--- a/server/helpers/ffmpeg-utils.ts
+++ b/server/helpers/ffmpeg-utils.ts
@@ -679,10 +679,16 @@ function getFFmpegVersion () {
679 679
680 return execPromise(`${ffmpegPath} -version`) 680 return execPromise(`${ffmpegPath} -version`)
681 .then(stdout => { 681 .then(stdout => {
682 const parsed = stdout.match(/ffmpeg version .?(\d+\.\d+\.\d+)/) 682 const parsed = stdout.match(/ffmpeg version .?(\d+\.\d+(\.\d+)?)/)
683 if (!parsed || !parsed[1]) return rej(new Error(`Could not find ffmpeg version in ${stdout}`)) 683 if (!parsed || !parsed[1]) return rej(new Error(`Could not find ffmpeg version in ${stdout}`))
684 684
685 return res(parsed[1]) 685 // Fix ffmpeg version that does not include patch version (4.4 for example)
686 let version = parsed[1]
687 if (version.match(/^\d+\.\d+/)) {
688 version += '.0'
689 }
690
691 return res(version)
686 }) 692 })
687 .catch(err => rej(err)) 693 .catch(err => rej(err))
688 }) 694 })