|
@@ -142,7 +142,7 @@ export class MediaService {
|
|
|
const mainVideoStream = this.getMainVideoStream(videoStreams);
|
|
|
const mainAudioStream = this.getMainAudioStream(audioStreams);
|
|
|
const containerExtension = format.formatName;
|
|
|
- if (!mainVideoStream || !mainAudioStream || !containerExtension) {
|
|
|
+ if (!mainVideoStream || !containerExtension) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -182,7 +182,7 @@ export class MediaService {
|
|
|
private isTranscodeRequired(
|
|
|
asset: AssetEntity,
|
|
|
videoStream: VideoStreamInfo,
|
|
|
- audioStream: AudioStreamInfo,
|
|
|
+ audioStream: AudioStreamInfo | null,
|
|
|
containerExtension: string,
|
|
|
ffmpegConfig: SystemConfigFFmpegDto,
|
|
|
): boolean {
|
|
@@ -192,12 +192,18 @@ export class MediaService {
|
|
|
}
|
|
|
|
|
|
const isTargetVideoCodec = videoStream.codecName === ffmpegConfig.targetVideoCodec;
|
|
|
- const isTargetAudioCodec = audioStream.codecName === ffmpegConfig.targetAudioCodec;
|
|
|
const isTargetContainer = ['mov,mp4,m4a,3gp,3g2,mj2', 'mp4', 'mov'].includes(containerExtension);
|
|
|
-
|
|
|
- this.logger.verbose(
|
|
|
- `${asset.id}: AudioCodecName ${audioStream.codecName}, AudioStreamCodecType ${audioStream.codecType}, containerExtension ${containerExtension}`,
|
|
|
- );
|
|
|
+ const isTargetAudioCodec = audioStream == null || audioStream.codecName === ffmpegConfig.targetAudioCodec;
|
|
|
+
|
|
|
+ if (audioStream != null) {
|
|
|
+ this.logger.verbose(
|
|
|
+ `${asset.id}: AudioCodecName ${audioStream.codecName}, AudioStreamCodecType ${audioStream.codecType}, containerExtension ${containerExtension}`,
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ this.logger.verbose(
|
|
|
+ `${asset.id}: AudioCodecName None, AudioStreamCodecType None, containerExtension ${containerExtension}`,
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
const allTargetsMatching = isTargetVideoCodec && isTargetAudioCodec && isTargetContainer;
|
|
|
const scalingEnabled = ffmpegConfig.targetResolution !== 'original';
|