]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/videos/transcoding.ts
Fix audio transcoding with video only file
[github/Chocobozzz/PeerTube.git] / server / controllers / api / videos / transcoding.ts
index dd6fbd3de51b0616584c7cf4d09d1cbed25fde8d..388689c8afa0a113696bf5d03b02f36454067c7b 100644 (file)
@@ -29,7 +29,7 @@ async function createTranscoding (req: express.Request, res: express.Response) {
 
   const body: VideoTranscodingCreate = req.body
 
-  const { resolution: maxResolution, isPortraitMode } = await video.getMaxQualityResolution()
+  const { resolution: maxResolution, isPortraitMode, audioStream } = await video.getMaxQualityFileInfo()
   const resolutions = computeLowerResolutionsToTranscode(maxResolution, 'vod').concat([ maxResolution ])
 
   video.state = VideoState.TO_TRANSCODE
@@ -42,6 +42,7 @@ async function createTranscoding (req: express.Request, res: express.Response) {
         videoUUID: video.uuid,
         resolution,
         isPortraitMode,
+        hasAudio: !!audioStream,
         copyCodecs: false,
         isNewVideo: false,
         autoDeleteWebTorrentIfNeeded: false,
@@ -53,6 +54,7 @@ async function createTranscoding (req: express.Request, res: express.Response) {
         videoUUID: video.uuid,
         isNewVideo: false,
         resolution: resolution,
+        hasAudio: !!audioStream,
         isPortraitMode
       })
     }