diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-08 11:28:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-08 11:28:51 +0200 |
commit | 318b0bd0c2ff575f35d51d97327f77abfecd6b86 (patch) | |
tree | 095a464dc053c06bc7a9c1e6a50a18ac9a7e4dce /server/lib/transcoding/video-transcoding.ts | |
parent | 5982ffc4b5c926ea51f5bb3ca48f0f2f8f5bd621 (diff) | |
download | PeerTube-318b0bd0c2ff575f35d51d97327f77abfecd6b86.tar.gz PeerTube-318b0bd0c2ff575f35d51d97327f77abfecd6b86.tar.zst PeerTube-318b0bd0c2ff575f35d51d97327f77abfecd6b86.zip |
Fix "height not divisible by 2" ffmpeg error
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 | ||