refactor(server): video transcode processor (#2163)

* refactor(server): video transcode processor

* refactor: rename shouldRotate to isVideoVertical, remove unnecessary await

* refactor: rename getOptions to getFfmpegOptions to be clearer in that context

* fix: optimal preset converting vertical videos already smaller than target resolution

---------

Co-authored-by: Zack Pollard <zackpollard@ymail.com>
This commit is contained in:
Jason Rasmussen
2023-04-04 10:48:02 -04:00
committed by GitHub
parent ec6a7ae97c
commit 48393c215b
9 changed files with 347 additions and 196 deletions

View File

@@ -18,6 +18,7 @@ import {
mapUser,
SearchResult,
SharedLinkResponseDto,
VideoInfo,
} from '../src';
const today = new Date();
@@ -704,3 +705,51 @@ export const searchStub = {
facets: [],
}),
};
export const probeStub = {
empty: { streams: [] },
multiple: Object.freeze<VideoInfo>({
streams: [
{
height: 1080,
width: 400,
codecName: 'h265',
codecType: 'video',
frameCount: 100,
rotation: 0,
},
{
height: 1080,
width: 400,
codecName: 'h7000',
codecType: 'video',
frameCount: 99,
rotation: 0,
},
],
}),
noHeight: Object.freeze<VideoInfo>({
streams: [
{
height: 0,
width: 400,
codecName: 'h265',
codecType: 'video',
frameCount: 100,
rotation: 0,
},
],
}),
tooBig: Object.freeze<VideoInfo>({
streams: [
{
height: 10000,
width: 10000,
codecName: 'h264',
codecType: 'video',
frameCount: 100,
rotation: 0,
},
],
}),
};