diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/videos/video-transcoder.ts | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index 3cd43e99b..4923759da 100644 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts | |||
@@ -4,7 +4,7 @@ import * as chai from 'chai' | |||
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { omit } from 'lodash' | 5 | import { omit } from 'lodash' |
6 | import { getMaxBitrate, VideoDetails, VideoResolution, VideoState } from '../../../../shared/models/videos' | 6 | import { getMaxBitrate, VideoDetails, VideoResolution, VideoState } from '../../../../shared/models/videos' |
7 | import { audio, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' | 7 | import { audio, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution, canDoQuickTranscode } from '../../../helpers/ffmpeg-utils' |
8 | import { | 8 | import { |
9 | buildAbsoluteFixturePath, cleanupTests, | 9 | buildAbsoluteFixturePath, cleanupTests, |
10 | doubleFollow, | 10 | doubleFollow, |
@@ -13,15 +13,14 @@ import { | |||
13 | getMyVideos, | 13 | getMyVideos, |
14 | getVideo, | 14 | getVideo, |
15 | getVideosList, | 15 | getVideosList, |
16 | killallServers, | 16 | waitJobs, |
17 | root, | 17 | root, |
18 | ServerInfo, | 18 | ServerInfo, |
19 | setAccessTokensToServers, | 19 | setAccessTokensToServers, |
20 | uploadVideo, | 20 | uploadVideo, |
21 | webtorrentAdd | 21 | webtorrentAdd |
22 | } from '../../../../shared/extra-utils' | 22 | } from '../../../../shared/extra-utils' |
23 | import { extname, join } from 'path' | 23 | import { join } from 'path' |
24 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | ||
25 | import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' | 24 | import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' |
26 | 25 | ||
27 | const expect = chai.expect | 26 | const expect = chai.expect |
@@ -324,6 +323,15 @@ describe('Test video transcoding', function () { | |||
324 | it('Should accept and transcode additional extensions', async function () { | 323 | it('Should accept and transcode additional extensions', async function () { |
325 | this.timeout(300000) | 324 | this.timeout(300000) |
326 | 325 | ||
326 | let tempFixturePath: string | ||
327 | |||
328 | { | ||
329 | tempFixturePath = await generateHighBitrateVideo() | ||
330 | |||
331 | const bitrate = await getVideoFileBitrate(tempFixturePath) | ||
332 | expect(bitrate).to.be.above(getMaxBitrate(VideoResolution.H_1080P, 60, VIDEO_TRANSCODING_FPS)) | ||
333 | } | ||
334 | |||
327 | for (const fixture of [ 'video_short.mkv', 'video_short.avi' ]) { | 335 | for (const fixture of [ 'video_short.mkv', 'video_short.avi' ]) { |
328 | const videoAttributes = { | 336 | const videoAttributes = { |
329 | name: fixture, | 337 | name: fixture, |
@@ -349,6 +357,13 @@ describe('Test video transcoding', function () { | |||
349 | } | 357 | } |
350 | }) | 358 | }) |
351 | 359 | ||
360 | it('Should correctly detect if quick transcode is possible', async function () { | ||
361 | this.timeout(10000) | ||
362 | |||
363 | expect(await canDoQuickTranscode(buildAbsoluteFixturePath('video_short.mp4'))).to.be.true | ||
364 | expect(await canDoQuickTranscode(buildAbsoluteFixturePath('video_short.webm'))).to.be.false | ||
365 | }) | ||
366 | |||
352 | after(async function () { | 367 | after(async function () { |
353 | await cleanupTests(servers) | 368 | await cleanupTests(servers) |
354 | }) | 369 | }) |