diff options
Diffstat (limited to 'server/tests/api/videos/audio-only.ts')
-rw-r--r-- | server/tests/api/videos/audio-only.ts | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.ts index f12d730cc..ac7a0b89c 100644 --- a/server/tests/api/videos/audio-only.ts +++ b/server/tests/api/videos/audio-only.ts | |||
@@ -1,28 +1,21 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { | 5 | import { |
6 | checkDirectoryIsEmpty, | ||
7 | checkSegmentHash, | ||
8 | checkTmpIsEmpty, | ||
9 | cleanupTests, | 6 | cleanupTests, |
10 | doubleFollow, | 7 | doubleFollow, |
11 | flushAndRunMultipleServers, | 8 | flushAndRunMultipleServers, |
12 | getPlaylist, | 9 | getVideo, |
13 | getVideo, makeGetRequest, makeRawRequest, | 10 | root, |
14 | removeVideo, root, | ||
15 | ServerInfo, | 11 | ServerInfo, |
16 | setAccessTokensToServers, updateCustomSubConfig, | 12 | setAccessTokensToServers, |
17 | updateVideo, | ||
18 | uploadVideo, | 13 | uploadVideo, |
19 | waitJobs, webtorrentAdd | 14 | waitJobs |
20 | } from '../../../../shared/extra-utils' | 15 | } from '../../../../shared/extra-utils' |
21 | import { VideoDetails } from '../../../../shared/models/videos' | 16 | import { VideoDetails } from '../../../../shared/models/videos' |
22 | import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' | ||
23 | import { join } from 'path' | 17 | import { join } from 'path' |
24 | import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' | 18 | import { audio, getVideoStreamSize } from '@server/helpers/ffmpeg-utils' |
25 | import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution, audio, getVideoStreamSize } from '@server/helpers/ffmpeg-utils' | ||
26 | 19 | ||
27 | const expect = chai.expect | 20 | const expect = chai.expect |
28 | 21 | ||
@@ -87,14 +80,14 @@ describe('Test audio only video transcoding', function () { | |||
87 | 80 | ||
88 | it('0p transcoded video should not have video', async function () { | 81 | it('0p transcoded video should not have video', async function () { |
89 | const paths = [ | 82 | const paths = [ |
90 | join(root(), 'test' + servers[ 0 ].internalServerNumber, 'videos', videoUUID + '-0.mp4'), | 83 | join(root(), 'test' + servers[0].internalServerNumber, 'videos', videoUUID + '-0.mp4'), |
91 | join(root(), 'test' + servers[ 0 ].internalServerNumber, 'streaming-playlists', 'hls', videoUUID, videoUUID + '-0-fragmented.mp4') | 84 | join(root(), 'test' + servers[0].internalServerNumber, 'streaming-playlists', 'hls', videoUUID, videoUUID + '-0-fragmented.mp4') |
92 | ] | 85 | ] |
93 | 86 | ||
94 | for (const path of paths) { | 87 | for (const path of paths) { |
95 | const { audioStream } = await audio.get(path) | 88 | const { audioStream } = await audio.get(path) |
96 | expect(audioStream[ 'codec_name' ]).to.be.equal('aac') | 89 | expect(audioStream['codec_name']).to.be.equal('aac') |
97 | expect(audioStream[ 'bit_rate' ]).to.be.at.most(384 * 8000) | 90 | expect(audioStream['bit_rate']).to.be.at.most(384 * 8000) |
98 | 91 | ||
99 | const size = await getVideoStreamSize(path) | 92 | const size = await getVideoStreamSize(path) |
100 | expect(size.height).to.equal(0) | 93 | expect(size.height).to.equal(0) |