mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Support transcoding options/encoders by plugins
This commit is contained in:
parent
529b37527c
commit
1896bca09e
32 changed files with 754 additions and 135 deletions
|
@ -87,6 +87,7 @@ describe('Test config API validators', function () {
|
|||
allowAdditionalExtensions: true,
|
||||
allowAudioFiles: true,
|
||||
threads: 1,
|
||||
profile: 'vod_profile',
|
||||
resolutions: {
|
||||
'0p': false,
|
||||
'240p': false,
|
||||
|
@ -115,6 +116,7 @@ describe('Test config API validators', function () {
|
|||
transcoding: {
|
||||
enabled: true,
|
||||
threads: 4,
|
||||
profile: 'live_profile',
|
||||
resolutions: {
|
||||
'240p': true,
|
||||
'360p': true,
|
||||
|
|
|
@ -70,6 +70,7 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) {
|
|||
expect(data.transcoding.allowAdditionalExtensions).to.be.false
|
||||
expect(data.transcoding.allowAudioFiles).to.be.false
|
||||
expect(data.transcoding.threads).to.equal(2)
|
||||
expect(data.transcoding.profile).to.equal('default')
|
||||
expect(data.transcoding.resolutions['240p']).to.be.true
|
||||
expect(data.transcoding.resolutions['360p']).to.be.true
|
||||
expect(data.transcoding.resolutions['480p']).to.be.true
|
||||
|
@ -87,6 +88,7 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) {
|
|||
expect(data.live.maxUserLives).to.equal(3)
|
||||
expect(data.live.transcoding.enabled).to.be.false
|
||||
expect(data.live.transcoding.threads).to.equal(2)
|
||||
expect(data.live.transcoding.profile).to.equal('default')
|
||||
expect(data.live.transcoding.resolutions['240p']).to.be.false
|
||||
expect(data.live.transcoding.resolutions['360p']).to.be.false
|
||||
expect(data.live.transcoding.resolutions['480p']).to.be.false
|
||||
|
@ -159,6 +161,7 @@ function checkUpdatedConfig (data: CustomConfig) {
|
|||
expect(data.transcoding.threads).to.equal(1)
|
||||
expect(data.transcoding.allowAdditionalExtensions).to.be.true
|
||||
expect(data.transcoding.allowAudioFiles).to.be.true
|
||||
expect(data.transcoding.profile).to.equal('vod_profile')
|
||||
expect(data.transcoding.resolutions['240p']).to.be.false
|
||||
expect(data.transcoding.resolutions['360p']).to.be.true
|
||||
expect(data.transcoding.resolutions['480p']).to.be.true
|
||||
|
@ -175,6 +178,7 @@ function checkUpdatedConfig (data: CustomConfig) {
|
|||
expect(data.live.maxUserLives).to.equal(10)
|
||||
expect(data.live.transcoding.enabled).to.be.true
|
||||
expect(data.live.transcoding.threads).to.equal(4)
|
||||
expect(data.live.transcoding.profile).to.equal('live_profile')
|
||||
expect(data.live.transcoding.resolutions['240p']).to.be.true
|
||||
expect(data.live.transcoding.resolutions['360p']).to.be.true
|
||||
expect(data.live.transcoding.resolutions['480p']).to.be.true
|
||||
|
@ -319,6 +323,7 @@ describe('Test config', function () {
|
|||
allowAdditionalExtensions: true,
|
||||
allowAudioFiles: true,
|
||||
threads: 1,
|
||||
profile: 'vod_profile',
|
||||
resolutions: {
|
||||
'0p': false,
|
||||
'240p': false,
|
||||
|
@ -345,6 +350,7 @@ describe('Test config', function () {
|
|||
transcoding: {
|
||||
enabled: true,
|
||||
threads: 4,
|
||||
profile: 'live_profile',
|
||||
resolutions: {
|
||||
'240p': true,
|
||||
'360p': true,
|
||||
|
|
|
@ -511,7 +511,9 @@ describe('Test video transcoding', function () {
|
|||
|
||||
const resolutions = [ 240, 360, 480, 720, 1080 ]
|
||||
for (const r of resolutions) {
|
||||
expect(await getServerFileSize(servers[1], `videos/${videoUUID}-${r}.mp4`)).to.be.below(60_000)
|
||||
const path = `videos/${videoUUID}-${r}.mp4`
|
||||
const size = await getServerFileSize(servers[1], path)
|
||||
expect(size, `${path} not below ${60_000}`).to.be.below(60_000)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue