From 1c3206736743646d41a667c03f3e499cc3e3373f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 5 May 2020 16:27:46 +0200 Subject: Fix HLS audio only transcoding --- server/helpers/ffmpeg-utils.ts | 1 + server/lib/job-queue/handlers/video-transcoding.ts | 1 + server/models/video/video-playlist.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index 9dac4448e..557fb5e3a 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts @@ -423,6 +423,7 @@ async function buildHLSCommand (command: ffmpeg.FfmpegCommand, options: HLSTrans const videoPath = getHLSVideoPath(options) if (options.copyCodecs) command = presetCopy(command) + else if (options.resolution === VideoResolution.H_NOVIDEO) command = presetOnlyAudio(command) else command = await buildx264Command(command, options) command = command.outputOption('-hls_time 4') diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index 46add57d4..04aac515f 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts @@ -92,6 +92,7 @@ async function onVideoFileOptimizerSuccess (videoArg: MVideoWithFile, payload: O let videoPublished = false + // Generate HLS version of the max quality file const hlsPayload = Object.assign({}, payload, { resolution: videoDatabase.getMaxQualityFile().resolution }) await createHlsJobIfEnabled(hlsPayload) diff --git a/server/models/video/video-playlist.ts b/server/models/video/video-playlist.ts index b17fd1060..b9b95e067 100644 --- a/server/models/video/video-playlist.ts +++ b/server/models/video/video-playlist.ts @@ -230,7 +230,7 @@ export class VideoPlaylistModel extends Model { @AllowNull(true) @Is('VideoPlaylistDescription', value => throwIfNotValid(value, isVideoPlaylistDescriptionValid, 'description', true)) - @Column + @Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEO_PLAYLISTS.DESCRIPTION.max)) description: string @AllowNull(false) -- cgit v1.2.3