mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Prefer web videos in favour of webtorrent
This commit is contained in:
parent
c3030e944a
commit
784e2ad5c3
102 changed files with 579 additions and 570 deletions
|
@ -14,7 +14,7 @@ import {
|
|||
describe('Test audio only video transcoding', function () {
|
||||
let servers: PeerTubeServer[] = []
|
||||
let videoUUID: string
|
||||
let webtorrentAudioFileUrl: string
|
||||
let webVideoAudioFileUrl: string
|
||||
let fragmentedAudioFileUrl: string
|
||||
|
||||
before(async function () {
|
||||
|
@ -71,7 +71,7 @@ describe('Test audio only video transcoding', function () {
|
|||
}
|
||||
|
||||
if (server.serverNumber === 1) {
|
||||
webtorrentAudioFileUrl = video.files[2].fileUrl
|
||||
webVideoAudioFileUrl = video.files[2].fileUrl
|
||||
fragmentedAudioFileUrl = video.streamingPlaylists[0].files[2].fileUrl
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ describe('Test audio only video transcoding', function () {
|
|||
|
||||
it('0p transcoded video should not have video', async function () {
|
||||
const paths = [
|
||||
servers[0].servers.buildWebTorrentFilePath(webtorrentAudioFileUrl),
|
||||
servers[0].servers.buildWebVideoFilePath(webVideoAudioFileUrl),
|
||||
servers[0].servers.buildFragmentedFilePath(videoUUID, fragmentedAudioFileUrl)
|
||||
]
|
||||
|
||||
|
|
|
@ -96,12 +96,12 @@ function runTests (enableObjectStorage: boolean) {
|
|||
}
|
||||
})
|
||||
|
||||
it('Should generate WebTorrent', async function () {
|
||||
it('Should generate Web Video', async function () {
|
||||
this.timeout(60000)
|
||||
|
||||
await servers[0].videos.runTranscoding({
|
||||
videoId: videoUUID,
|
||||
transcodingType: 'webtorrent'
|
||||
transcodingType: 'web-video'
|
||||
})
|
||||
|
||||
await waitJobs(servers)
|
||||
|
@ -117,13 +117,13 @@ function runTests (enableObjectStorage: boolean) {
|
|||
}
|
||||
})
|
||||
|
||||
it('Should generate WebTorrent from HLS only video', async function () {
|
||||
it('Should generate Web Video from HLS only video', async function () {
|
||||
this.timeout(60000)
|
||||
|
||||
await servers[0].videos.removeAllWebTorrentFiles({ videoId: videoUUID })
|
||||
await servers[0].videos.removeAllWebVideoFiles({ videoId: videoUUID })
|
||||
await waitJobs(servers)
|
||||
|
||||
await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' })
|
||||
await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'web-video' })
|
||||
await waitJobs(servers)
|
||||
|
||||
for (const server of servers) {
|
||||
|
@ -137,13 +137,13 @@ function runTests (enableObjectStorage: boolean) {
|
|||
}
|
||||
})
|
||||
|
||||
it('Should only generate WebTorrent', async function () {
|
||||
it('Should only generate Web Video', async function () {
|
||||
this.timeout(60000)
|
||||
|
||||
await servers[0].videos.removeHLSPlaylist({ videoId: videoUUID })
|
||||
await waitJobs(servers)
|
||||
|
||||
await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' })
|
||||
await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'web-video' })
|
||||
await waitJobs(servers)
|
||||
|
||||
for (const server of servers) {
|
||||
|
|
|
@ -111,7 +111,7 @@ describe('Test HLS videos', function () {
|
|||
await doubleFollow(servers[0], servers[1])
|
||||
})
|
||||
|
||||
describe('With WebTorrent & HLS enabled', function () {
|
||||
describe('With Web Video & HLS enabled', function () {
|
||||
runTestSuite(false)
|
||||
})
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ describe('Test video transcoding', function () {
|
|||
expect(videoDetails.files).to.have.lengthOf(5)
|
||||
|
||||
const file = videoDetails.files.find(f => f.resolution.id === 240)
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
const probe = await getAudioStream(path)
|
||||
|
||||
if (probe.audioStream) {
|
||||
|
@ -281,7 +281,7 @@ describe('Test video transcoding', function () {
|
|||
const videoDetails = await server.videos.get({ id: video.id })
|
||||
|
||||
const file = videoDetails.files.find(f => f.resolution.id === 240)
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
|
||||
expect(await hasAudioStream(path)).to.be.false
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ describe('Test video transcoding', function () {
|
|||
const fixtureVideoProbe = await getAudioStream(fixturePath)
|
||||
|
||||
const file = videoDetails.files.find(f => f.resolution.id === 240)
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
|
||||
const videoProbe = await getAudioStream(path)
|
||||
|
||||
|
@ -472,14 +472,14 @@ describe('Test video transcoding', function () {
|
|||
|
||||
for (const resolution of [ 144, 240, 360, 480 ]) {
|
||||
const file = videoDetails.files.find(f => f.resolution.id === resolution)
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
const fps = await getVideoStreamFPS(path)
|
||||
|
||||
expect(fps).to.be.below(31)
|
||||
}
|
||||
|
||||
const file = videoDetails.files.find(f => f.resolution.id === 720)
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
const fps = await getVideoStreamFPS(path)
|
||||
|
||||
expect(fps).to.be.above(58).and.below(62)
|
||||
|
@ -516,14 +516,14 @@ describe('Test video transcoding', function () {
|
|||
|
||||
{
|
||||
const file = video.files.find(f => f.resolution.id === 240)
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
const fps = await getVideoStreamFPS(path)
|
||||
expect(fps).to.be.equal(25)
|
||||
}
|
||||
|
||||
{
|
||||
const file = video.files.find(f => f.resolution.id === 720)
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
const fps = await getVideoStreamFPS(path)
|
||||
expect(fps).to.be.equal(59)
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ describe('Test video transcoding', function () {
|
|||
|
||||
for (const resolution of [ 240, 360, 480, 720, 1080 ]) {
|
||||
const file = video.files.find(f => f.resolution.id === resolution)
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
|
||||
const bitrate = await getVideoStreamBitrate(path)
|
||||
const fps = await getVideoStreamFPS(path)
|
||||
|
@ -607,7 +607,7 @@ describe('Test video transcoding', function () {
|
|||
for (const r of resolutions) {
|
||||
const file = video.files.find(f => f.resolution.id === r)
|
||||
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
const bitrate = await getVideoStreamBitrate(path)
|
||||
|
||||
const inputBitrate = 60_000
|
||||
|
@ -631,7 +631,7 @@ describe('Test video transcoding', function () {
|
|||
{
|
||||
const video = await servers[1].videos.get({ id: videoUUID })
|
||||
const file = video.files.find(f => f.resolution.id === 240)
|
||||
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
|
||||
const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
|
||||
|
||||
const probe = await ffprobePromise(path)
|
||||
const metadata = new VideoFileMetadata(probe)
|
||||
|
@ -704,14 +704,14 @@ describe('Test video transcoding', function () {
|
|||
expect(transcodingJobs).to.have.lengthOf(16)
|
||||
|
||||
const hlsJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-hls')
|
||||
const webtorrentJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-webtorrent')
|
||||
const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-webtorrent')
|
||||
const webVideoJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-web-video')
|
||||
const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-web-video')
|
||||
|
||||
expect(hlsJobs).to.have.lengthOf(8)
|
||||
expect(webtorrentJobs).to.have.lengthOf(7)
|
||||
expect(webVideoJobs).to.have.lengthOf(7)
|
||||
expect(optimizeJobs).to.have.lengthOf(1)
|
||||
|
||||
for (const j of optimizeJobs.concat(hlsJobs.concat(webtorrentJobs))) {
|
||||
for (const j of optimizeJobs.concat(hlsJobs.concat(webVideoJobs))) {
|
||||
expect(j.priority).to.be.greaterThan(100)
|
||||
expect(j.priority).to.be.lessThan(150)
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ describe('Test update video privacy while transcoding', function () {
|
|||
await doubleFollow(servers[0], servers[1])
|
||||
})
|
||||
|
||||
describe('With WebTorrent & HLS enabled', function () {
|
||||
describe('With Web Video & HLS enabled', function () {
|
||||
runTestSuite(false)
|
||||
})
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ describe('Test video studio', function () {
|
|||
describe('HLS only studio edition', function () {
|
||||
|
||||
before(async function () {
|
||||
// Disable webtorrent
|
||||
// Disable Web Videos
|
||||
await servers[0].config.updateExistingSubConfig({
|
||||
newConfig: {
|
||||
transcoding: {
|
||||
|
@ -354,8 +354,8 @@ describe('Test video studio', function () {
|
|||
expect(oldFileUrls).to.not.include(f.fileUrl)
|
||||
}
|
||||
|
||||
for (const webtorrentFile of video.files) {
|
||||
expectStartWith(webtorrentFile.fileUrl, objectStorage.getMockWebVideosBaseUrl())
|
||||
for (const webVideoFile of video.files) {
|
||||
expectStartWith(webVideoFile.fileUrl, objectStorage.getMockWebVideosBaseUrl())
|
||||
}
|
||||
|
||||
for (const hlsFile of video.streamingPlaylists[0].files) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue