1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Fix resolution for portrait videos

This commit is contained in:
Chocobozzz 2018-02-27 15:57:28 +01:00
parent 6fdc553adb
commit 056aa7f2b4
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 27 additions and 19 deletions

View file

@ -3,7 +3,7 @@ import { extname, join } from 'path'
import { VideoCreate, VideoPrivacy, VideoUpdate } from '../../../../shared'
import { renamePromise } from '../../../helpers/core-utils'
import { retryTransactionWrapper } from '../../../helpers/database-utils'
import { getVideoFileHeight } from '../../../helpers/ffmpeg-utils'
import { getVideoFileResolution } from '../../../helpers/ffmpeg-utils'
import { processImage } from '../../../helpers/image-utils'
import { logger } from '../../../helpers/logger'
import { createReqFiles, getFormattedObjects, getServerActor, resetSequelizeInstance } from '../../../helpers/utils'
@ -187,11 +187,11 @@ async function addVideo (req: express.Request, res: express.Response, videoPhysi
const video = new VideoModel(videoData)
video.url = getVideoActivityPubUrl(video)
const videoFileHeight = await getVideoFileHeight(videoPhysicalFile.path)
const { videoFileResolution } = await getVideoFileResolution(videoPhysicalFile.path)
const videoFileData = {
extname: extname(videoPhysicalFile.filename),
resolution: videoFileHeight,
resolution: videoFileResolution,
size: videoPhysicalFile.size
}
const videoFile = new VideoFileModel(videoFileData)