aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/ffmpeg-utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-27 16:12:41 +0200
committerChocobozzz <me@florianbigard.com>2021-05-27 16:12:41 +0200
commit8f608a4cb22ab232cfab20665050764b38bac9c7 (patch)
tree6a6785aae79bf5939ad7b7a50a1bd8031268d2b4 /server/helpers/ffmpeg-utils.ts
parent030ccfce59a8cb8f2fee6ea8dd363ba635c5c5c2 (diff)
parentc215e627b575d2c4085ccb222f4ca8d0237b7552 (diff)
downloadPeerTube-8f608a4cb22ab232cfab20665050764b38bac9c7.tar.gz
PeerTube-8f608a4cb22ab232cfab20665050764b38bac9c7.tar.zst
PeerTube-8f608a4cb22ab232cfab20665050764b38bac9c7.zip
Merge branch 'develop' into shorter-URLs-channels-accounts
Diffstat (limited to 'server/helpers/ffmpeg-utils.ts')
-rw-r--r--server/helpers/ffmpeg-utils.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts
index 75297df8f..e328c49ac 100644
--- a/server/helpers/ffmpeg-utils.ts
+++ b/server/helpers/ffmpeg-utils.ts
@@ -236,7 +236,6 @@ async function getLiveTranscodingCommand (options: {
236 } 236 }
237 ] 237 ]
238 238
239 command.outputOption('-preset superfast')
240 command.outputOption('-sc_threshold 0') 239 command.outputOption('-sc_threshold 0')
241 240
242 addDefaultEncoderGlobalParams({ command }) 241 addDefaultEncoderGlobalParams({ command })
@@ -679,10 +678,16 @@ function getFFmpegVersion () {
679 678
680 return execPromise(`${ffmpegPath} -version`) 679 return execPromise(`${ffmpegPath} -version`)
681 .then(stdout => { 680 .then(stdout => {
682 const parsed = stdout.match(/ffmpeg version .?(\d+\.\d+\.\d+)/) 681 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}`)) 682 if (!parsed || !parsed[1]) return rej(new Error(`Could not find ffmpeg version in ${stdout}`))
684 683
685 return res(parsed[1]) 684 // Fix ffmpeg version that does not include patch version (4.4 for example)
685 let version = parsed[1]
686 if (version.match(/^\d+\.\d+$/)) {
687 version += '.0'
688 }
689
690 return res(version)
686 }) 691 })
687 .catch(err => rej(err)) 692 .catch(err => rej(err))
688 }) 693 })