Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Prevent broken transcoding with audio only input

Chocobozzz44e702ded455
diff --git a/server/controllers/api/videos/transcoding.ts b/server/controllers/api/videos/transcoding.ts
index a39e47dfe4..8c9a5322b7 100644
--- a/server/controllers/api/videos/transcoding.ts
+++ b/server/controllers/api/videos/transcoding.ts
@@ -49,6 +49,8 @@ async function createTranscoding (req: express.Request, res: express.Response) {
const childrenResolutions = resolutions.filter(r => r !== maxResolution)
+ logger.info('Manually creating transcoding jobs for %s.', body.transcodingType, { childrenResolutions, maxResolution })
+
const children = await Bluebird.mapSeries(childrenResolutions, resolution => {
if (body.transcodingType === 'hls') {
return buildHLSJobOption({
diff --git a/shared/extra-utils/ffprobe.ts b/shared/extra-utils/ffprobe.ts
index b95202464f..b8e9f4c180 100644
--- a/shared/extra-utils/ffprobe.ts
+++ b/shared/extra-utils/ffprobe.ts
@@ -1,5 +1,5 @@
import { ffprobe, FfprobeData } from 'fluent-ffmpeg'
-import { VideoFileMetadata } from '@shared/models/videos'
+import { VideoFileMetadata, VideoResolution } from '@shared/models/videos'
/**
*
@@ -103,7 +103,15 @@ function getMaxAudioBitrate (type: 'aac' | 'mp3' | string, bitrate: number) {
async function getVideoStreamDimensionsInfo (path: string, existingProbe?: FfprobeData) {
const videoStream = await getVideoStream(path, existingProbe)
- if (!videoStream) return undefined
+ if (!videoStream) {
+ return {
+ width: 0,
+ height: 0,
+ ratio: 0,
+ resolution: VideoResolution.H_NOVIDEO,
+ isPortraitMode: false
+ }
+ }
return {
width: videoStream.width,