diff options
Diffstat (limited to 'server/lib/transcoding/video-transcoding.ts')
-rw-r--r-- | server/lib/transcoding/video-transcoding.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/lib/transcoding/video-transcoding.ts b/server/lib/transcoding/video-transcoding.ts index 5df192575..1ad63baf3 100644 --- a/server/lib/transcoding/video-transcoding.ts +++ b/server/lib/transcoding/video-transcoding.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Job } from 'bull' | 1 | import { Job } from 'bull' |
2 | import { copyFile, ensureDir, move, remove, stat } from 'fs-extra' | 2 | import { copyFile, ensureDir, move, remove, stat } from 'fs-extra' |
3 | import { basename, extname as extnameUtil, join } from 'path' | 3 | import { basename, extname as extnameUtil, join } from 'path' |
4 | import { toEven } from '@server/helpers/core-utils' | ||
4 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' | 5 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' |
5 | import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoFullLight } from '@server/types/models' | 6 | import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoFullLight } from '@server/types/models' |
6 | import { VideoResolution } from '../../../shared/models/videos' | 7 | import { VideoResolution } from '../../../shared/models/videos' |
@@ -35,6 +36,8 @@ async function optimizeOriginalVideofile (video: MVideoFullLight, inputVideoFile | |||
35 | ? 'quick-transcode' | 36 | ? 'quick-transcode' |
36 | : 'video' | 37 | : 'video' |
37 | 38 | ||
39 | const resolution = toEven(inputVideoFile.resolution) | ||
40 | |||
38 | const transcodeOptions: TranscodeOptions = { | 41 | const transcodeOptions: TranscodeOptions = { |
39 | type: transcodeType, | 42 | type: transcodeType, |
40 | 43 | ||
@@ -44,7 +47,7 @@ async function optimizeOriginalVideofile (video: MVideoFullLight, inputVideoFile | |||
44 | availableEncoders: VideoTranscodingProfilesManager.Instance.getAvailableEncoders(), | 47 | availableEncoders: VideoTranscodingProfilesManager.Instance.getAvailableEncoders(), |
45 | profile: CONFIG.TRANSCODING.PROFILE, | 48 | profile: CONFIG.TRANSCODING.PROFILE, |
46 | 49 | ||
47 | resolution: inputVideoFile.resolution, | 50 | resolution, |
48 | 51 | ||
49 | job | 52 | job |
50 | } | 53 | } |
@@ -57,7 +60,7 @@ async function optimizeOriginalVideofile (video: MVideoFullLight, inputVideoFile | |||
57 | 60 | ||
58 | // Important to do this before getVideoFilename() to take in account the new filename | 61 | // Important to do this before getVideoFilename() to take in account the new filename |
59 | inputVideoFile.extname = newExtname | 62 | inputVideoFile.extname = newExtname |
60 | inputVideoFile.filename = generateVideoFilename(video, false, inputVideoFile.resolution, newExtname) | 63 | inputVideoFile.filename = generateVideoFilename(video, false, resolution, newExtname) |
61 | 64 | ||
62 | const videoOutputPath = getVideoFilePath(video, inputVideoFile) | 65 | const videoOutputPath = getVideoFilePath(video, inputVideoFile) |
63 | 66 | ||