aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/fixtures/video_60fps_short.mp4bin0 -> 33968 bytes
-rw-r--r--server/tests/api/videos/video-transcoder.ts33
2 files changed, 32 insertions, 1 deletions
diff --git a/server/tests/api/fixtures/video_60fps_short.mp4 b/server/tests/api/fixtures/video_60fps_short.mp4
new file mode 100644
index 000000000..ff0593cf3
--- /dev/null
+++ b/server/tests/api/fixtures/video_60fps_short.mp4
Binary files differ
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index c494e7f67..ef929960d 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -2,10 +2,13 @@
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { VideoDetails } from '../../../../shared/models/videos'
6import { getVideoFileFPS } from '../../../helpers/ffmpeg-utils'
5import { 7import {
6 flushAndRunMultipleServers, flushTests, getVideo, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo, 8 flushAndRunMultipleServers, flushTests, getVideo, getVideosList, killallServers, root, ServerInfo, setAccessTokensToServers, uploadVideo,
7 wait, webtorrentAdd 9 wait, webtorrentAdd
8} from '../../utils' 10} from '../../utils'
11import { join } from 'path'
9 12
10const expect = chai.expect 13const expect = chai.expect
11 14
@@ -78,6 +81,34 @@ describe('Test video transcoding', function () {
78 expect(torrent.files[0].path).match(/\.mp4$/) 81 expect(torrent.files[0].path).match(/\.mp4$/)
79 }) 82 })
80 83
84 it('Should transcode to 30 FPS', async function () {
85 this.timeout(60000)
86
87 const videoAttributes = {
88 name: 'my super 30fps name for server 2',
89 description: 'my super 30fps description for server 2',
90 fixture: 'video_60fps_short.mp4'
91 }
92 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes)
93
94 await wait(20000)
95
96 const res = await getVideosList(servers[1].url)
97
98 const video = res.body.data[0]
99 const res2 = await getVideo(servers[1].url, video.id)
100 const videoDetails: VideoDetails = res2.body
101
102 expect(videoDetails.files).to.have.lengthOf(1)
103
104 for (const resolution of [ '240' ]) {
105 const path = join(root(), 'test2', 'videos', video.uuid + '-' + resolution + '.mp4')
106 const fps = await getVideoFileFPS(path)
107
108 expect(fps).to.be.below(31)
109 }
110 })
111
81 after(async function () { 112 after(async function () {
82 killallServers(servers) 113 killallServers(servers)
83 114