diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-26 10:48:53 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-26 11:08:38 +0100 |
commit | 73c695919c6569bfb667c36fc5a6b9b862130a0d (patch) | |
tree | 6a6b2a9007e2e3ec3a36bc0c649bedb83e2f9ca3 /server/tests | |
parent | 1125c40a32cfd6066a5da5aa4da6d709577b5601 (diff) | |
download | PeerTube-73c695919c6569bfb667c36fc5a6b9b862130a0d.tar.gz PeerTube-73c695919c6569bfb667c36fc5a6b9b862130a0d.tar.zst PeerTube-73c695919c6569bfb667c36fc5a6b9b862130a0d.zip |
Add 30 fps limit in transcoding
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/fixtures/video_60fps_short.mp4 | bin | 0 -> 33968 bytes | |||
-rw-r--r-- | server/tests/api/videos/video-transcoder.ts | 33 |
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 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { VideoDetails } from '../../../../shared/models/videos' | ||
6 | import { getVideoFileFPS } from '../../../helpers/ffmpeg-utils' | ||
5 | import { | 7 | import { |
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' |
11 | import { join } from 'path' | ||
9 | 12 | ||
10 | const expect = chai.expect | 13 | const 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 | ||