Prevent broken transcoding with audio only input
This commit is contained in:
parent
4efa5535cc
commit
44e702ded4
2 changed files with 12 additions and 2 deletions
|
@ -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({
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue