import { expect } from 'chai'
import { basename, join } from 'path'
-import { ffprobePromise, getVideoStream } from '@server/helpers/ffmpeg'
-import { testImage, testVideoResolutions } from '@server/tests/shared'
+import { SQLCommand, testImage, testLiveVideoResolutions } from '@server/tests/shared'
import { getAllFiles, wait } from '@shared/core-utils'
+import { ffprobePromise, getVideoStream } from '@shared/ffmpeg'
import {
HttpStatusCode,
LiveVideo,
describe('Live transcoding', function () {
let liveVideoId: string
+ let sqlCommandServer1: SQLCommand
async function createLiveWrapper (saveReplay: boolean) {
const liveAttributes = {
before(async function () {
await updateConf([])
+
+ sqlCommandServer1 = new SQLCommand(servers[0])
})
it('Should enable transcoding without additional resolutions', async function () {
await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
await waitJobs(servers)
- await testVideoResolutions({
+ await testLiveVideoResolutions({
originServer: servers[0],
+ sqlCommand: sqlCommandServer1,
servers,
liveVideoId,
resolutions: [ 720 ],
await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
await waitJobs(servers)
- await testVideoResolutions({
+ await testLiveVideoResolutions({
originServer: servers[0],
+ sqlCommand: sqlCommandServer1,
servers,
liveVideoId,
resolutions: resolutions.concat([ 720 ]),
await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
await waitJobs(servers)
- await testVideoResolutions({
+ await testLiveVideoResolutions({
originServer: servers[0],
+ sqlCommand: sqlCommandServer1,
servers,
liveVideoId,
resolutions,
await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
await waitJobs(servers)
- await testVideoResolutions({
+ await testLiveVideoResolutions({
originServer: servers[0],
+ sqlCommand: sqlCommandServer1,
servers,
liveVideoId,
resolutions,
await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
await waitJobs(servers)
- await testVideoResolutions({
+ await testLiveVideoResolutions({
originServer: servers[0],
+ sqlCommand: sqlCommandServer1,
servers,
liveVideoId,
resolutions: [ 720 ],
expect(hlsFiles[0].resolution.id).to.equal(720)
})
+
+ after(async function () {
+ await sqlCommandServer1.cleanup()
+ })
})
describe('After a server restart', function () {