From: Chocobozzz Date: Tue, 5 May 2020 14:27:46 +0000 (+0200) Subject: Fix HLS audio only transcoding X-Git-Tag: v2.2.0-rc.1~85 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1c3206736743646d41a667c03f3e499cc3e3373f;p=oweals%2Fpeertube.git Fix HLS audio only transcoding --- 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)