aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-06 14:45:57 +0200
committerChocobozzz <me@florianbigard.com>2019-06-06 14:45:57 +0200
commitad3405d087b306efa5eb62a69c9b797b04eab4ce (patch)
treefd81a190cc0c5fe80a2d70465dcb4a4789b62a5f /server
parenta6dbbf03865a955caaedc3b12f3de3e386fe850f (diff)
downloadPeerTube-ad3405d087b306efa5eb62a69c9b797b04eab4ce.tar.gz
PeerTube-ad3405d087b306efa5eb62a69c9b797b04eab4ce.tar.zst
PeerTube-ad3405d087b306efa5eb62a69c9b797b04eab4ce.zip
Improve 4K video quality after transcoding
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/videos/index.ts6
-rw-r--r--server/helpers/ffmpeg-utils.ts3
2 files changed, 5 insertions, 4 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 40a2c972b..99900ca4a 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -205,11 +205,11 @@ async function addVideo (req: express.Request, res: express.Response) {
205 } 205 }
206 const videoFile = new VideoFileModel(videoFileData) 206 const videoFile = new VideoFileModel(videoFileData)
207 207
208 if (!videoFile.isAudio()) { 208 if (videoFile.isAudio()) {
209 videoFile.resolution = DEFAULT_AUDIO_RESOLUTION
210 } else {
209 videoFile.fps = await getVideoFileFPS(videoPhysicalFile.path) 211 videoFile.fps = await getVideoFileFPS(videoPhysicalFile.path)
210 videoFile.resolution = (await getVideoFileResolution(videoPhysicalFile.path)).videoFileResolution 212 videoFile.resolution = (await getVideoFileResolution(videoPhysicalFile.path)).videoFileResolution
211 } else {
212 videoFile.resolution = DEFAULT_AUDIO_RESOLUTION
213 } 213 }
214 214
215 // Move physical file 215 // Move physical file
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts
index c180da832..8041e7b3b 100644
--- a/server/helpers/ffmpeg-utils.ts
+++ b/server/helpers/ffmpeg-utils.ts
@@ -18,7 +18,8 @@ function computeResolutionsToTranscode (videoFileHeight: number) {
18 VideoResolution.H_360P, 18 VideoResolution.H_360P,
19 VideoResolution.H_720P, 19 VideoResolution.H_720P,
20 VideoResolution.H_240P, 20 VideoResolution.H_240P,
21 VideoResolution.H_1080P 21 VideoResolution.H_1080P,
22 VideoResolution.H_4K
22 ] 23 ]
23 24
24 for (const resolution of resolutions) { 25 for (const resolution of resolutions) {