feat(server): only transcode streams that require it (#7106)
This commit is contained in:
43
server/test/fixtures/media.stub.ts
vendored
43
server/test/fixtures/media.stub.ts
vendored
@@ -13,16 +13,14 @@ const probeStubDefaultVideoStream: VideoStreamInfo[] = [
|
||||
height: 1080,
|
||||
width: 1920,
|
||||
codecName: 'hevc',
|
||||
codecType: 'video',
|
||||
frameCount: 100,
|
||||
rotation: 0,
|
||||
isHDR: false,
|
||||
bitrate: 0,
|
||||
},
|
||||
];
|
||||
|
||||
const probeStubDefaultAudioStream: AudioStreamInfo[] = [
|
||||
{ index: 1, codecName: 'aac', codecType: 'audio', frameCount: 100 },
|
||||
];
|
||||
const probeStubDefaultAudioStream: AudioStreamInfo[] = [{ index: 1, codecName: 'mp3', frameCount: 100 }];
|
||||
|
||||
const probeStubDefault: VideoInfo = {
|
||||
format: probeStubDefaultFormat,
|
||||
@@ -41,20 +39,20 @@ export const probeStub = {
|
||||
height: 1080,
|
||||
width: 400,
|
||||
codecName: 'hevc',
|
||||
codecType: 'video',
|
||||
frameCount: 100,
|
||||
rotation: 0,
|
||||
isHDR: false,
|
||||
bitrate: 0,
|
||||
},
|
||||
{
|
||||
index: 1,
|
||||
height: 1080,
|
||||
width: 400,
|
||||
codecName: 'h7000',
|
||||
codecType: 'video',
|
||||
frameCount: 99,
|
||||
rotation: 0,
|
||||
isHDR: false,
|
||||
bitrate: 0,
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -66,10 +64,10 @@ export const probeStub = {
|
||||
height: 0,
|
||||
width: 400,
|
||||
codecName: 'hevc',
|
||||
codecType: 'video',
|
||||
frameCount: 100,
|
||||
rotation: 0,
|
||||
isHDR: false,
|
||||
bitrate: 0,
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -81,21 +79,16 @@ export const probeStub = {
|
||||
height: 2160,
|
||||
width: 3840,
|
||||
codecName: 'h264',
|
||||
codecType: 'video',
|
||||
frameCount: 100,
|
||||
rotation: 0,
|
||||
isHDR: false,
|
||||
bitrate: 0,
|
||||
},
|
||||
],
|
||||
}),
|
||||
videoStream40Mbps: Object.freeze<VideoInfo>({
|
||||
...probeStubDefault,
|
||||
format: {
|
||||
formatName: 'mov,mp4,m4a,3gp,3g2,mj2',
|
||||
formatLongName: 'QuickTime / MOV',
|
||||
duration: 0,
|
||||
bitrate: 40_000_000,
|
||||
},
|
||||
videoStreams: [{ ...probeStubDefaultVideoStream[0], bitrate: 40_000_000 }],
|
||||
}),
|
||||
videoStreamHDR: Object.freeze<VideoInfo>({
|
||||
...probeStubDefault,
|
||||
@@ -105,10 +98,10 @@ export const probeStub = {
|
||||
height: 480,
|
||||
width: 480,
|
||||
codecName: 'h264',
|
||||
codecType: 'video',
|
||||
frameCount: 100,
|
||||
rotation: 0,
|
||||
isHDR: true,
|
||||
bitrate: 0,
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -120,10 +113,10 @@ export const probeStub = {
|
||||
height: 2160,
|
||||
width: 3840,
|
||||
codecName: 'h264',
|
||||
codecType: 'video',
|
||||
frameCount: 100,
|
||||
rotation: 90,
|
||||
isHDR: false,
|
||||
bitrate: 0,
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -135,10 +128,10 @@ export const probeStub = {
|
||||
height: 355,
|
||||
width: 1586,
|
||||
codecName: 'h264',
|
||||
codecType: 'video',
|
||||
frameCount: 100,
|
||||
rotation: 0,
|
||||
isHDR: false,
|
||||
bitrate: 0,
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -150,16 +143,16 @@ export const probeStub = {
|
||||
height: 1586,
|
||||
width: 355,
|
||||
codecName: 'h264',
|
||||
codecType: 'video',
|
||||
frameCount: 100,
|
||||
rotation: 0,
|
||||
isHDR: false,
|
||||
bitrate: 0,
|
||||
},
|
||||
],
|
||||
}),
|
||||
audioStreamMp3: Object.freeze<VideoInfo>({
|
||||
audioStreamAac: Object.freeze<VideoInfo>({
|
||||
...probeStubDefault,
|
||||
audioStreams: [{ index: 1, codecType: 'audio', codecName: 'aac', frameCount: 100 }],
|
||||
audioStreams: [{ index: 1, codecName: 'aac', frameCount: 100 }],
|
||||
}),
|
||||
matroskaContainer: Object.freeze<VideoInfo>({
|
||||
...probeStubDefault,
|
||||
@@ -170,4 +163,14 @@ export const probeStub = {
|
||||
bitrate: 0,
|
||||
},
|
||||
}),
|
||||
videoStreamVp9: Object.freeze<VideoInfo>({
|
||||
...probeStubDefault,
|
||||
videoStreams: [{ ...probeStubDefaultVideoStream[0], codecName: 'vp9' }],
|
||||
format: {
|
||||
formatName: 'matroska,webm',
|
||||
formatLongName: 'Matroska / WebM',
|
||||
duration: 0,
|
||||
bitrate: 0,
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user