mirror of https://github.com/Chocobozzz/PeerTube
Fix ffmpeg version checker
parent
16de9ff46d
commit
60f1f61579
|
@ -679,10 +679,16 @@ function getFFmpegVersion () {
|
||||||
|
|
||||||
return execPromise(`${ffmpegPath} -version`)
|
return execPromise(`${ffmpegPath} -version`)
|
||||||
.then(stdout => {
|
.then(stdout => {
|
||||||
const parsed = stdout.match(/ffmpeg version .?(\d+\.\d+\.\d+)/)
|
const parsed = stdout.match(/ffmpeg version .?(\d+\.\d+(\.\d+)?)/)
|
||||||
if (!parsed || !parsed[1]) return rej(new Error(`Could not find ffmpeg version in ${stdout}`))
|
if (!parsed || !parsed[1]) return rej(new Error(`Could not find ffmpeg version in ${stdout}`))
|
||||||
|
|
||||||
return res(parsed[1])
|
// Fix ffmpeg version that does not include patch version (4.4 for example)
|
||||||
|
let version = parsed[1]
|
||||||
|
if (version.match(/^\d+\.\d+/)) {
|
||||||
|
version += '.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
return res(version)
|
||||||
})
|
})
|
||||||
.catch(err => rej(err))
|
.catch(err => rej(err))
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue