diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-09 10:36:21 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-04-09 15:53:18 +0200 |
commit | 3e03b961b8ab897500dfea626f808c009f64e551 (patch) | |
tree | bfde6c71a4a63b77fe94536149d0b68cf02110c9 /server/tests/plugins | |
parent | d2351bcfd4cfed4b728df170593e0c6b66aa6762 (diff) | |
download | PeerTube-3e03b961b8ab897500dfea626f808c009f64e551.tar.gz PeerTube-3e03b961b8ab897500dfea626f808c009f64e551.tar.zst PeerTube-3e03b961b8ab897500dfea626f808c009f64e551.zip |
Add ability for plugins to specify scale filter
Diffstat (limited to 'server/tests/plugins')
-rw-r--r-- | server/tests/plugins/plugin-transcoding.ts | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/server/tests/plugins/plugin-transcoding.ts b/server/tests/plugins/plugin-transcoding.ts index 415705ca1..b6dff930e 100644 --- a/server/tests/plugins/plugin-transcoding.ts +++ b/server/tests/plugins/plugin-transcoding.ts | |||
@@ -15,9 +15,11 @@ import { | |||
15 | sendRTMPStreamInVideo, | 15 | sendRTMPStreamInVideo, |
16 | setAccessTokensToServers, | 16 | setAccessTokensToServers, |
17 | setDefaultVideoChannel, | 17 | setDefaultVideoChannel, |
18 | testFfmpegStreamError, | ||
18 | uninstallPlugin, | 19 | uninstallPlugin, |
19 | updateCustomSubConfig, | 20 | updateCustomSubConfig, |
20 | uploadVideoAndGetId, | 21 | uploadVideoAndGetId, |
22 | waitFfmpegUntilError, | ||
21 | waitJobs, | 23 | waitJobs, |
22 | waitUntilLivePublished | 24 | waitUntilLivePublished |
23 | } from '../../../shared/extra-utils' | 25 | } from '../../../shared/extra-utils' |
@@ -119,8 +121,8 @@ describe('Test transcoding plugins', function () { | |||
119 | const res = await getConfig(server.url) | 121 | const res = await getConfig(server.url) |
120 | const config = res.body as ServerConfig | 122 | const config = res.body as ServerConfig |
121 | 123 | ||
122 | expect(config.transcoding.availableProfiles).to.have.members([ 'default', 'low-vod', 'video-filters-vod', 'input-options-vod' ]) | 124 | expect(config.transcoding.availableProfiles).to.have.members([ 'default', 'low-vod', 'input-options-vod', 'bad-scale-vod' ]) |
123 | expect(config.live.transcoding.availableProfiles).to.have.members([ 'default', 'low-live', 'input-options-live' ]) | 125 | expect(config.live.transcoding.availableProfiles).to.have.members([ 'default', 'low-live', 'input-options-live', 'bad-scale-live' ]) |
124 | }) | 126 | }) |
125 | 127 | ||
126 | it('Should not use the plugin profile if not chosen by the admin', async function () { | 128 | it('Should not use the plugin profile if not chosen by the admin', async function () { |
@@ -143,26 +145,31 @@ describe('Test transcoding plugins', function () { | |||
143 | await checkVideoFPS(videoUUID, 'below', 12) | 145 | await checkVideoFPS(videoUUID, 'below', 12) |
144 | }) | 146 | }) |
145 | 147 | ||
146 | it('Should apply video filters in vod profile', async function () { | 148 | it('Should apply input options in vod profile', async function () { |
147 | this.timeout(120000) | 149 | this.timeout(120000) |
148 | 150 | ||
149 | await updateConf(server, 'video-filters-vod', 'default') | 151 | await updateConf(server, 'input-options-vod', 'default') |
150 | 152 | ||
151 | const videoUUID = (await uploadVideoAndGetId({ server, videoName: 'video' })).uuid | 153 | const videoUUID = (await uploadVideoAndGetId({ server, videoName: 'video' })).uuid |
152 | await waitJobs([ server ]) | 154 | await waitJobs([ server ]) |
153 | 155 | ||
154 | await checkVideoFPS(videoUUID, 'below', 12) | 156 | await checkVideoFPS(videoUUID, 'below', 6) |
155 | }) | 157 | }) |
156 | 158 | ||
157 | it('Should apply input options in vod profile', async function () { | 159 | it('Should apply the scale filter in vod profile', async function () { |
158 | this.timeout(120000) | 160 | this.timeout(120000) |
159 | 161 | ||
160 | await updateConf(server, 'input-options-vod', 'default') | 162 | await updateConf(server, 'bad-scale-vod', 'default') |
161 | 163 | ||
162 | const videoUUID = (await uploadVideoAndGetId({ server, videoName: 'video' })).uuid | 164 | const videoUUID = (await uploadVideoAndGetId({ server, videoName: 'video' })).uuid |
163 | await waitJobs([ server ]) | 165 | await waitJobs([ server ]) |
164 | 166 | ||
165 | await checkVideoFPS(videoUUID, 'below', 6) | 167 | // Transcoding failed |
168 | const res = await getVideo(server.url, videoUUID) | ||
169 | const video: VideoDetails = res.body | ||
170 | |||
171 | expect(video.files).to.have.lengthOf(1) | ||
172 | expect(video.streamingPlaylists).to.have.lengthOf(0) | ||
166 | }) | 173 | }) |
167 | 174 | ||
168 | it('Should not use the plugin profile if not chosen by the admin', async function () { | 175 | it('Should not use the plugin profile if not chosen by the admin', async function () { |
@@ -205,6 +212,17 @@ describe('Test transcoding plugins', function () { | |||
205 | await checkLiveFPS(liveVideoId, 'below', 6) | 212 | await checkLiveFPS(liveVideoId, 'below', 6) |
206 | }) | 213 | }) |
207 | 214 | ||
215 | it('Should apply the scale filter name on live profile', async function () { | ||
216 | this.timeout(120000) | ||
217 | |||
218 | await updateConf(server, 'low-vod', 'bad-scale-live') | ||
219 | |||
220 | const liveVideoId = await createLiveWrapper(server) | ||
221 | |||
222 | const command = await sendRTMPStreamInVideo(server.url, server.accessToken, liveVideoId, 'video_short2.webm') | ||
223 | await testFfmpegStreamError(command, true) | ||
224 | }) | ||
225 | |||
208 | it('Should default to the default profile if the specified profile does not exist', async function () { | 226 | it('Should default to the default profile if the specified profile does not exist', async function () { |
209 | this.timeout(120000) | 227 | this.timeout(120000) |
210 | 228 | ||