diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-29 16:41:29 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-29 17:10:54 +0200 |
commit | 3a6f351b255d21ec42578632600ba699885f350e (patch) | |
tree | fdc770f5f59a87a929a5c85da9aed783e9676097 /server/tests/api | |
parent | 34b19192901b0f872c72ce8d94a69aeba51d1c29 (diff) | |
download | PeerTube-3a6f351b255d21ec42578632600ba699885f350e.tar.gz PeerTube-3a6f351b255d21ec42578632600ba699885f350e.tar.zst PeerTube-3a6f351b255d21ec42578632600ba699885f350e.zip |
Handle higher FPS for high resolution (test)
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/videos/video-transcoder.ts | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index 2b203c26b..fe750253e 100644 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts | |||
@@ -91,13 +91,13 @@ describe('Test video transcoding', function () { | |||
91 | expect(torrent.files[0].path).match(/\.mp4$/) | 91 | expect(torrent.files[0].path).match(/\.mp4$/) |
92 | }) | 92 | }) |
93 | 93 | ||
94 | it('Should transcode to 30 FPS', async function () { | 94 | it('Should transcode a 60 FPS video', async function () { |
95 | this.timeout(60000) | 95 | this.timeout(60000) |
96 | 96 | ||
97 | const videoAttributes = { | 97 | const videoAttributes = { |
98 | name: 'my super 30fps name for server 2', | 98 | name: 'my super 30fps name for server 2', |
99 | description: 'my super 30fps description for server 2', | 99 | description: 'my super 30fps description for server 2', |
100 | fixture: 'video_60fps_short.mp4' | 100 | fixture: '60fps_720p_small.mp4' |
101 | } | 101 | } |
102 | await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) | 102 | await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) |
103 | 103 | ||
@@ -109,14 +109,23 @@ describe('Test video transcoding', function () { | |||
109 | const res2 = await getVideo(servers[1].url, video.id) | 109 | const res2 = await getVideo(servers[1].url, video.id) |
110 | const videoDetails: VideoDetails = res2.body | 110 | const videoDetails: VideoDetails = res2.body |
111 | 111 | ||
112 | expect(videoDetails.files).to.have.lengthOf(1) | 112 | expect(videoDetails.files).to.have.lengthOf(4) |
113 | expect(videoDetails.files[0].fps).to.be.above(58).and.below(62) | ||
114 | expect(videoDetails.files[1].fps).to.be.below(31) | ||
115 | expect(videoDetails.files[2].fps).to.be.below(31) | ||
116 | expect(videoDetails.files[3].fps).to.be.below(31) | ||
113 | 117 | ||
114 | for (const resolution of [ '240' ]) { | 118 | for (const resolution of [ '240', '360', '480' ]) { |
115 | const path = join(root(), 'test2', 'videos', video.uuid + '-' + resolution + '.mp4') | 119 | const path = join(root(), 'test2', 'videos', video.uuid + '-' + resolution + '.mp4') |
116 | const fps = await getVideoFileFPS(path) | 120 | const fps = await getVideoFileFPS(path) |
117 | 121 | ||
118 | expect(fps).to.be.below(31) | 122 | expect(fps).to.be.below(31) |
119 | } | 123 | } |
124 | |||
125 | const path = join(root(), 'test2', 'videos', video.uuid + '-720.mp4') | ||
126 | const fps = await getVideoFileFPS(path) | ||
127 | |||
128 | expect(fps).to.be.above(58).and.below(62) | ||
120 | }) | 129 | }) |
121 | 130 | ||
122 | it('Should wait transcoding before publishing the video', async function () { | 131 | it('Should wait transcoding before publishing the video', async function () { |