From 6b67897e2eab96978daee40aeaf716835856d65d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 24 Nov 2020 16:29:39 +0100 Subject: Add transcoding module comments --- server/lib/video-transcoding.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'server/lib/video-transcoding.ts') diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts index aaad219dd..e022f2a68 100644 --- a/server/lib/video-transcoding.ts +++ b/server/lib/video-transcoding.ts @@ -16,8 +16,13 @@ import { generateVideoStreamingPlaylistName, getVideoFilename, getVideoFilePath import { availableEncoders } from './video-transcoding-profiles' /** - * Optimize the original video file and replace it. The resolution is not changed. + * + * Functions that run transcoding functions, update the database, cleanup files, create torrent files... + * Mainly called by the job queue + * */ + +// Optimize the original video file and replace it. The resolution is not changed. async function optimizeOriginalVideofile (video: MVideoWithFile, inputVideoFileArg?: MVideoFile) { const transcodeDirectory = CONFIG.STORAGE.TMP_DIR const newExtname = '.mp4' @@ -62,9 +67,7 @@ async function optimizeOriginalVideofile (video: MVideoWithFile, inputVideoFileA } } -/** - * Transcode the original video file to a lower resolution. - */ +// Transcode the original video file to a lower resolution. async function transcodeNewResolution (video: MVideoWithFile, resolution: VideoResolution, isPortrait: boolean) { const transcodeDirectory = CONFIG.STORAGE.TMP_DIR const extname = '.mp4' @@ -110,6 +113,7 @@ async function transcodeNewResolution (video: MVideoWithFile, resolution: VideoR return onVideoFileTranscoding(video, newVideoFile, videoTranscodedPath, videoOutputPath) } +// Merge an image with an audio file to create a video async function mergeAudioVideofile (video: MVideoWithAllFiles, resolution: VideoResolution) { const transcodeDirectory = CONFIG.STORAGE.TMP_DIR const newExtname = '.mp4' @@ -159,6 +163,7 @@ async function mergeAudioVideofile (video: MVideoWithAllFiles, resolution: Video return onVideoFileTranscoding(video, inputVideoFile, videoTranscodedPath, videoOutputPath) } +// Generate an HLS playlist from an input file, and update the master playlist async function generateHlsPlaylist (options: { video: MVideoWithFile videoInputPath: string -- cgit v1.2.3