diff options
Diffstat (limited to 'server/tests/api/transcoding/transcoder.ts')
-rw-r--r-- | server/tests/api/transcoding/transcoder.ts | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/server/tests/api/transcoding/transcoder.ts b/server/tests/api/transcoding/transcoder.ts index 3cd247a24..36e1d90f4 100644 --- a/server/tests/api/transcoding/transcoder.ts +++ b/server/tests/api/transcoding/transcoder.ts | |||
@@ -251,7 +251,7 @@ describe('Test video transcoding', function () { | |||
251 | expect(videoDetails.files).to.have.lengthOf(5) | 251 | expect(videoDetails.files).to.have.lengthOf(5) |
252 | 252 | ||
253 | const file = videoDetails.files.find(f => f.resolution.id === 240) | 253 | const file = videoDetails.files.find(f => f.resolution.id === 240) |
254 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 254 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
255 | const probe = await getAudioStream(path) | 255 | const probe = await getAudioStream(path) |
256 | 256 | ||
257 | if (probe.audioStream) { | 257 | if (probe.audioStream) { |
@@ -281,7 +281,7 @@ describe('Test video transcoding', function () { | |||
281 | const videoDetails = await server.videos.get({ id: video.id }) | 281 | const videoDetails = await server.videos.get({ id: video.id }) |
282 | 282 | ||
283 | const file = videoDetails.files.find(f => f.resolution.id === 240) | 283 | const file = videoDetails.files.find(f => f.resolution.id === 240) |
284 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 284 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
285 | 285 | ||
286 | expect(await hasAudioStream(path)).to.be.false | 286 | expect(await hasAudioStream(path)).to.be.false |
287 | } | 287 | } |
@@ -310,7 +310,7 @@ describe('Test video transcoding', function () { | |||
310 | const fixtureVideoProbe = await getAudioStream(fixturePath) | 310 | const fixtureVideoProbe = await getAudioStream(fixturePath) |
311 | 311 | ||
312 | const file = videoDetails.files.find(f => f.resolution.id === 240) | 312 | const file = videoDetails.files.find(f => f.resolution.id === 240) |
313 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 313 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
314 | 314 | ||
315 | const videoProbe = await getAudioStream(path) | 315 | const videoProbe = await getAudioStream(path) |
316 | 316 | ||
@@ -472,14 +472,14 @@ describe('Test video transcoding', function () { | |||
472 | 472 | ||
473 | for (const resolution of [ 144, 240, 360, 480 ]) { | 473 | for (const resolution of [ 144, 240, 360, 480 ]) { |
474 | const file = videoDetails.files.find(f => f.resolution.id === resolution) | 474 | const file = videoDetails.files.find(f => f.resolution.id === resolution) |
475 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 475 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
476 | const fps = await getVideoStreamFPS(path) | 476 | const fps = await getVideoStreamFPS(path) |
477 | 477 | ||
478 | expect(fps).to.be.below(31) | 478 | expect(fps).to.be.below(31) |
479 | } | 479 | } |
480 | 480 | ||
481 | const file = videoDetails.files.find(f => f.resolution.id === 720) | 481 | const file = videoDetails.files.find(f => f.resolution.id === 720) |
482 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 482 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
483 | const fps = await getVideoStreamFPS(path) | 483 | const fps = await getVideoStreamFPS(path) |
484 | 484 | ||
485 | expect(fps).to.be.above(58).and.below(62) | 485 | expect(fps).to.be.above(58).and.below(62) |
@@ -516,14 +516,14 @@ describe('Test video transcoding', function () { | |||
516 | 516 | ||
517 | { | 517 | { |
518 | const file = video.files.find(f => f.resolution.id === 240) | 518 | const file = video.files.find(f => f.resolution.id === 240) |
519 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 519 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
520 | const fps = await getVideoStreamFPS(path) | 520 | const fps = await getVideoStreamFPS(path) |
521 | expect(fps).to.be.equal(25) | 521 | expect(fps).to.be.equal(25) |
522 | } | 522 | } |
523 | 523 | ||
524 | { | 524 | { |
525 | const file = video.files.find(f => f.resolution.id === 720) | 525 | const file = video.files.find(f => f.resolution.id === 720) |
526 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 526 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
527 | const fps = await getVideoStreamFPS(path) | 527 | const fps = await getVideoStreamFPS(path) |
528 | expect(fps).to.be.equal(59) | 528 | expect(fps).to.be.equal(59) |
529 | } | 529 | } |
@@ -556,7 +556,7 @@ describe('Test video transcoding', function () { | |||
556 | 556 | ||
557 | for (const resolution of [ 240, 360, 480, 720, 1080 ]) { | 557 | for (const resolution of [ 240, 360, 480, 720, 1080 ]) { |
558 | const file = video.files.find(f => f.resolution.id === resolution) | 558 | const file = video.files.find(f => f.resolution.id === resolution) |
559 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 559 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
560 | 560 | ||
561 | const bitrate = await getVideoStreamBitrate(path) | 561 | const bitrate = await getVideoStreamBitrate(path) |
562 | const fps = await getVideoStreamFPS(path) | 562 | const fps = await getVideoStreamFPS(path) |
@@ -607,7 +607,7 @@ describe('Test video transcoding', function () { | |||
607 | for (const r of resolutions) { | 607 | for (const r of resolutions) { |
608 | const file = video.files.find(f => f.resolution.id === r) | 608 | const file = video.files.find(f => f.resolution.id === r) |
609 | 609 | ||
610 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 610 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
611 | const bitrate = await getVideoStreamBitrate(path) | 611 | const bitrate = await getVideoStreamBitrate(path) |
612 | 612 | ||
613 | const inputBitrate = 60_000 | 613 | const inputBitrate = 60_000 |
@@ -631,7 +631,7 @@ describe('Test video transcoding', function () { | |||
631 | { | 631 | { |
632 | const video = await servers[1].videos.get({ id: videoUUID }) | 632 | const video = await servers[1].videos.get({ id: videoUUID }) |
633 | const file = video.files.find(f => f.resolution.id === 240) | 633 | const file = video.files.find(f => f.resolution.id === 240) |
634 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 634 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
635 | 635 | ||
636 | const probe = await ffprobePromise(path) | 636 | const probe = await ffprobePromise(path) |
637 | const metadata = new VideoFileMetadata(probe) | 637 | const metadata = new VideoFileMetadata(probe) |
@@ -704,14 +704,14 @@ describe('Test video transcoding', function () { | |||
704 | expect(transcodingJobs).to.have.lengthOf(16) | 704 | expect(transcodingJobs).to.have.lengthOf(16) |
705 | 705 | ||
706 | const hlsJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-hls') | 706 | const hlsJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-hls') |
707 | const webtorrentJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-webtorrent') | 707 | const webVideoJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-web-video') |
708 | const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-webtorrent') | 708 | const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-web-video') |
709 | 709 | ||
710 | expect(hlsJobs).to.have.lengthOf(8) | 710 | expect(hlsJobs).to.have.lengthOf(8) |
711 | expect(webtorrentJobs).to.have.lengthOf(7) | 711 | expect(webVideoJobs).to.have.lengthOf(7) |
712 | expect(optimizeJobs).to.have.lengthOf(1) | 712 | expect(optimizeJobs).to.have.lengthOf(1) |
713 | 713 | ||
714 | for (const j of optimizeJobs.concat(hlsJobs.concat(webtorrentJobs))) { | 714 | for (const j of optimizeJobs.concat(hlsJobs.concat(webVideoJobs))) { |
715 | expect(j.priority).to.be.greaterThan(100) | 715 | expect(j.priority).to.be.greaterThan(100) |
716 | expect(j.priority).to.be.lessThan(150) | 716 | expect(j.priority).to.be.lessThan(150) |
717 | } | 717 | } |