]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/ffmpeg-utils.ts
Load video in permanent live after last one ended
[github/Chocobozzz/PeerTube.git] / server / helpers / ffmpeg-utils.ts
index 9d6fe76cb97961d0c1d4cad932af607071a76020..bf6408d3e1c63b116c239b779b0622f47209766e 100644 (file)
@@ -137,6 +137,8 @@ interface HLSTranscodeOptions extends BaseTranscodeOptions {
 interface HLSFromTSTranscodeOptions extends BaseTranscodeOptions {
   type: 'hls-from-ts'
 
+  isAAC: boolean
+
   hlsPlaylist: {
     videoFilename: string
   }
@@ -456,9 +458,12 @@ async function buildHLSVODFromTSCommand (command: ffmpeg.FfmpegCommand, options:
   const videoPath = getHLSVideoPath(options)
 
   command.outputOption('-c copy')
-  // Required for example when copying an AAC stream from an MPEG-TS
-  // Since it's a bitstream filter, we don't need to reencode the audio
-  command.outputOption('-bsf:a aac_adtstoasc')
+
+  if (options.isAAC) {
+    // Required for example when copying an AAC stream from an MPEG-TS
+    // Since it's a bitstream filter, we don't need to reencode the audio
+    command.outputOption('-bsf:a aac_adtstoasc')
+  }
 
   addCommonHLSVODCommandOptions(command, videoPath)