Fix HLS audio only transcoding
authorChocobozzz <me@florianbigard.com>
Tue, 5 May 2020 14:27:46 +0000 (16:27 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 5 May 2020 14:27:46 +0000 (16:27 +0200)
server/helpers/ffmpeg-utils.ts
server/lib/job-queue/handlers/video-transcoding.ts
server/models/video/video-playlist.ts

index 9dac4448ec89df290de2ce1d7df2d70e02ceb639..557fb5e3aaf036c0547355aef3c8cc9d1a79876d 100644 (file)
@@ -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')
index 46add57d492bce13b55af7e0aacd3c9f57805c6a..04aac515f68e636674e57158a5a2d9a88ebb2d88 100644 (file)
@@ -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)
 
index b17fd106019b0d38e0db03014d643c876780d28f..b9b95e06719ba6bb5bb126555bbbd34e9b377c50 100644 (file)
@@ -230,7 +230,7 @@ export class VideoPlaylistModel extends Model<VideoPlaylistModel> {
 
   @AllowNull(true)
   @Is('VideoPlaylistDescription', value => throwIfNotValid(value, isVideoPlaylistDescriptionValid, 'description', true))
-  @Column
+  @Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEO_PLAYLISTS.DESCRIPTION.max))
   description: string
 
   @AllowNull(false)