X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fvideos%2Ftranscoding.ts;h=da3ea3c9c0abce4bb238933fbeddad2771e8399c;hb=f012319a644fe8d9d33f2f567fa828442a3b39fd;hp=dd6fbd3de51b0616584c7cf4d09d1cbed25fde8d;hpb=ad5db1044c8599eaaaa2a578b350777ae996b068;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/videos/transcoding.ts b/server/controllers/api/videos/transcoding.ts index dd6fbd3de..da3ea3c9c 100644 --- a/server/controllers/api/videos/transcoding.ts +++ b/server/controllers/api/videos/transcoding.ts @@ -1,5 +1,5 @@ import express from 'express' -import { computeLowerResolutionsToTranscode } from '@server/helpers/ffprobe-utils' +import { computeLowerResolutionsToTranscode } from '@server/helpers/ffmpeg' import { logger, loggerTagsFactory } from '@server/helpers/logger' import { addTranscodingJob } from '@server/lib/video' import { HttpStatusCode, UserRight, VideoState, VideoTranscodingCreate } from '@shared/models' @@ -25,11 +25,11 @@ export { async function createTranscoding (req: express.Request, res: express.Response) { const video = res.locals.videoAll - logger.info('Creating %s transcoding job for %s.', req.body.type, video.url, lTags()) + logger.info('Creating %s transcoding job for %s.', req.body.transcodingType, video.url, lTags()) const body: VideoTranscodingCreate = req.body - const { resolution: maxResolution, isPortraitMode } = await video.getMaxQualityResolution() + const { resolution: maxResolution, isPortraitMode, audioStream } = await video.probeMaxQualityFile() 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, @@ -52,7 +53,9 @@ async function createTranscoding (req: express.Request, res: express.Response) { type: 'new-resolution-to-webtorrent', videoUUID: video.uuid, isNewVideo: false, - resolution: resolution, + resolution, + hasAudio: !!audioStream, + createHLSIfNeeded: false, isPortraitMode }) }