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

@@ -153,3 +153,18 @@ export class ThumbnailGeneratorProcessor {
await this.mediaService.handleGenerateWepbThumbnail(job.data);
}
}
@Processor(QueueName.VIDEO_CONVERSION)
export class VideoTranscodeProcessor {
constructor(private mediaService: MediaService) {}
@Process({ name: JobName.QUEUE_VIDEO_CONVERSION, concurrency: 1 })
async onQueueVideoConversion(job: Job<IBaseJob>): Promise<void> {
await this.mediaService.handleQueueVideoConversion(job.data);
}
@Process({ name: JobName.VIDEO_CONVERSION, concurrency: 2 })
async onVideoConversion(job: Job<IAssetJob>) {
await this.mediaService.handleVideoConversion(job.data);
}
}