From 837666fe48f9ed786db75c96e2025cbcf20a1e3b Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 20 Jan 2020 20:40:30 +0100 Subject: Add tests for video downscale framerate matching --- server/tests/api/videos/video-transcoder.ts | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'server/tests/api/videos') diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index 4be74901a..0104c94fc 100644 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts @@ -11,6 +11,7 @@ import { doubleFollow, flushAndRunMultipleServers, generateHighBitrateVideo, + generateVideoWithFramerate, getMyVideos, getVideo, getVideosList, @@ -416,6 +417,39 @@ describe('Test video transcoding', function () { } }) + it('Should downscale to the closest divisor standard framerate', async function () { + this.timeout(160000) + + let tempFixturePath: string + + { + tempFixturePath = await generateVideoWithFramerate() + + const fps = await getVideoFileFPS(tempFixturePath) + expect(fps).to.be.equal(59) + } + + const videoAttributes = { + name: '59fps video', + description: '59fps video', + fixture: tempFixturePath + } + + await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) + + await waitJobs(servers) + + for (const server of servers) { + const res = await getVideosList(server.url) + + const video = res.body.data.find(v => v.name === videoAttributes.name) + const path = join(root(), 'test' + servers[1].internalServerNumber, 'videos', video.uuid + '-240.mp4') + const fps = await getVideoFileFPS(path) + + expect(fps).to.be.equal(25) + } + }) + after(async function () { await cleanupTests(servers) }) -- cgit v1.2.3