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