/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
import { basename, join } from 'path'
import { ffprobePromise, getVideoStream } from '@server/helpers/ffmpeg'
-import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist, getAllFiles, testImage } from '@server/tests/shared'
-import { wait } from '@shared/core-utils'
+import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist, testImage } from '@server/tests/shared'
+import { getAllFiles, wait } from '@shared/core-utils'
import {
HttpStatusCode,
LiveVideo,
waitUntilLivePublishedOnAllServers
} from '@shared/server-commands'
-const expect = chai.expect
-
describe('Test live', function () {
let servers: PeerTubeServer[] = []
let commands: LiveCommand[]
let vodVideoId: string
before(async function () {
- this.timeout(120000)
+ this.timeout(240000)
vodVideoId = (await servers[0].videos.quickUpload({ name: 'vod video' })).uuid
await stopFfmpeg(ffmpegCommand)
})
+ it('Should transcode audio only RTMP stream', async function () {
+ this.timeout(120000)
+
+ liveVideoId = await createLiveWrapper(false)
+
+ const ffmpegCommand = await commands[0].sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short_no_audio.mp4' })
+ await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
+ await waitJobs(servers)
+
+ await stopFfmpeg(ffmpegCommand)
+ })
+
it('Should enable transcoding with some resolutions', async function () {
this.timeout(120000)
expect(file.size).to.be.greaterThan(1)
if (resolution >= 720) {
- expect(file.fps).to.be.approximately(60, 2)
+ expect(file.fps).to.be.approximately(60, 10)
} else {
expect(file.fps).to.be.approximately(30, 2)
}
})
it('Should only keep the original resolution if all resolutions are disabled', async function () {
- this.timeout(400_000)
+ this.timeout(600_000)
await updateConf([])
liveVideoId = await createLiveWrapper(true)
}
before(async function () {
- this.timeout(300000)
+ this.timeout(600_000)
liveVideoId = await createLiveWrapper({ saveReplay: false, permanent: false })
liveVideoReplayId = await createLiveWrapper({ saveReplay: true, permanent: false })