X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-transcoder.ts;h=0104c94fcb9b228f4cf90bcc1f84d792ec92204d;hb=837666fe48f9ed786db75c96e2025cbcf20a1e3b;hp=90ade16525aa35ae059ad90f7325e255c26420a9;hpb=21d141c296541f41e399ec68aa7fa85e53d0dcb8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index 90ade1652..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, @@ -292,7 +293,7 @@ describe('Test video transcoding', function () { tempFixturePath = await generateHighBitrateVideo() const bitrate = await getVideoFileBitrate(tempFixturePath) - expect(bitrate).to.be.above(getMaxBitrate(VideoResolution.H_1080P, 60, VIDEO_TRANSCODING_FPS)) + expect(bitrate).to.be.above(getMaxBitrate(VideoResolution.H_1080P, 25, VIDEO_TRANSCODING_FPS)) } const videoAttributes = { @@ -331,7 +332,7 @@ describe('Test video transcoding', function () { tempFixturePath = await generateHighBitrateVideo() const bitrate = await getVideoFileBitrate(tempFixturePath) - expect(bitrate).to.be.above(getMaxBitrate(VideoResolution.H_1080P, 60, VIDEO_TRANSCODING_FPS)) + expect(bitrate).to.be.above(getMaxBitrate(VideoResolution.H_1080P, 25, VIDEO_TRANSCODING_FPS)) } for (const fixture of [ 'video_short.mkv', 'video_short.avi' ]) { @@ -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) })