1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

stricter youtubedl format selectors (#3516)

* stricter youtubedl format selectors

make sure selectors avoid av1, and otherwise match as closely to the
maximum resolution enabled for transcoding

* add support for merge formats in youtubedl

* avoid vp9.2 in youtubedl to avoid any HDR

* move getEnabledResolutions, safer replace of imported extension

* add test for youtube-dl selectors
This commit is contained in:
Rigel Kent 2021-01-15 15:56:56 +01:00 committed by GitHub
parent d43c6b1ffc
commit 454c20fa7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 196 additions and 61 deletions

View file

@ -201,6 +201,16 @@ function generateHlsPlaylist (options: {
})
}
function getEnabledResolutions (type: 'vod' | 'live') {
const transcoding = type === 'vod'
? CONFIG.TRANSCODING
: CONFIG.LIVE.TRANSCODING
return Object.keys(transcoding.RESOLUTIONS)
.filter(key => transcoding.ENABLED && transcoding.RESOLUTIONS[key] === true)
.map(r => parseInt(r, 10))
}
// ---------------------------------------------------------------------------
export {
@ -208,7 +218,8 @@ export {
generateHlsPlaylistFromTS,
optimizeOriginalVideofile,
transcodeNewResolution,
mergeAudioVideofile
mergeAudioVideofile,
getEnabledResolutions
}
// ---------------------------------------------------------------------------