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

Fix resolution for portrait videos

This commit is contained in:
Chocobozzz 2020-08-03 16:03:52 +02:00
parent 2045b57223
commit dca0fe12ec
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 15 additions and 7 deletions

View file

@ -75,7 +75,7 @@ async function onVideoFileOptimizerSuccess (videoArg: MVideoWithFile, payload: O
if (videoArg === undefined) return undefined
// Outside the transaction (IO on disk)
const { videoFileResolution } = await videoArg.getMaxQualityResolution()
const { videoFileResolution, isPortraitMode } = await videoArg.getMaxQualityResolution()
const { videoDatabase, videoPublished } = await sequelizeTypescript.transaction(async t => {
// Maybe the video changed in database, refresh it
@ -86,7 +86,7 @@ async function onVideoFileOptimizerSuccess (videoArg: MVideoWithFile, payload: O
// Create transcoding jobs if there are enabled resolutions
const resolutionsEnabled = computeResolutionsToTranscode(videoFileResolution)
logger.info(
'Resolutions computed for video %s and origin file height of %d.', videoDatabase.uuid, videoFileResolution,
'Resolutions computed for video %s and origin file resolution of %d.', videoDatabase.uuid, videoFileResolution,
{ resolutions: resolutionsEnabled }
)
@ -104,14 +104,15 @@ async function onVideoFileOptimizerSuccess (videoArg: MVideoWithFile, payload: O
dataInput = {
type: 'new-resolution' as 'new-resolution',
videoUUID: videoDatabase.uuid,
resolution
resolution,
isPortraitMode
}
} else if (CONFIG.TRANSCODING.HLS.ENABLED) {
dataInput = {
type: 'hls',
videoUUID: videoDatabase.uuid,
resolution,
isPortraitMode: false,
isPortraitMode,
copyCodecs: false
}
}