refactor(server): modularize getFfmpegOptions (#3138)

* refactored `getFfmpegOptions`

refactor transcoding, make separate service

* fixed enum casing

* use `Logger` instead of `console.log`

* review suggestions

* use enum for `getHandler`

* fixed formatting

* Update server/src/domain/media/media.util.ts

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>

* Update server/src/domain/media/media.util.ts

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>

* More specific imports, renamed codec classes

* simplified code

* removed unused import

* added tests

* added base implementation for bitrate and threads

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Mert
2023-07-08 22:43:11 -04:00
committed by GitHub
parent 27018e4ab6
commit 8349a28ed8
33 changed files with 1131 additions and 345 deletions

View File

@@ -4929,6 +4929,14 @@
"OTHER"
]
},
"AudioCodec": {
"type": "string",
"enum": [
"mp3",
"aac",
"opus"
]
},
"AuthDeviceResponseDto": {
"type": "object",
"properties": {
@@ -6347,13 +6355,16 @@
"threads": {
"type": "integer"
},
"preset": {
"type": "string"
},
"targetVideoCodec": {
"type": "string"
"$ref": "#/components/schemas/VideoCodec"
},
"targetAudioCodec": {
"$ref": "#/components/schemas/AudioCodec"
},
"transcode": {
"$ref": "#/components/schemas/TranscodePolicy"
},
"preset": {
"type": "string"
},
"targetResolution": {
@@ -6364,27 +6375,18 @@
},
"twoPass": {
"type": "boolean"
},
"transcode": {
"type": "string",
"enum": [
"all",
"optimal",
"required",
"disabled"
]
}
},
"required": [
"crf",
"threads",
"preset",
"targetVideoCodec",
"targetAudioCodec",
"transcode",
"preset",
"targetResolution",
"maxBitrate",
"twoPass",
"transcode"
"twoPass"
]
},
"SystemConfigJobDto": {
@@ -6604,6 +6606,15 @@
"month"
]
},
"TranscodePolicy": {
"type": "string",
"enum": [
"all",
"optimal",
"required",
"disabled"
]
},
"UpdateAlbumDto": {
"type": "object",
"properties": {
@@ -6804,6 +6815,14 @@
"required": [
"authStatus"
]
},
"VideoCodec": {
"type": "string",
"enum": [
"h264",
"hevc",
"vp9"
]
}
}
}