|
|
|
@ -233,6 +233,16 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService |
|
|
|
scanKind = await ProbeScanKind(ffmpegPath, videoVersion.MediaItem, cancellationToken); |
|
|
|
scanKind = await ProbeScanKind(ffmpegPath, videoVersion.MediaItem, cancellationToken); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HardwareAccelerationMode hwAccel = GetHardwareAccelerationMode(playbackSettings); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// QSV may have sync issues with h264 files that have multiple profiles
|
|
|
|
|
|
|
|
// check and flag here so software decoding can be used if needed
|
|
|
|
|
|
|
|
bool hasMultipleProfiles = false; |
|
|
|
|
|
|
|
if (hwAccel is HardwareAccelerationMode.Qsv && videoStream.Codec is VideoFormat.H264) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
hasMultipleProfiles = await ProbeHasMultipleProfiles(ffmpegPath, videoVersion.MediaItem, cancellationToken); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var ffmpegVideoStream = new VideoStream( |
|
|
|
var ffmpegVideoStream = new VideoStream( |
|
|
|
videoStream.Index, |
|
|
|
videoStream.Index, |
|
|
|
videoStream.Codec, |
|
|
|
videoStream.Codec, |
|
|
|
@ -248,7 +258,10 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService |
|
|
|
videoVersion.MediaVersion.DisplayAspectRatio, |
|
|
|
videoVersion.MediaVersion.DisplayAspectRatio, |
|
|
|
new FrameRate(videoVersion.MediaVersion.RFrameRate), |
|
|
|
new FrameRate(videoVersion.MediaVersion.RFrameRate), |
|
|
|
videoPath != audioPath, // still image when paths are different
|
|
|
|
videoPath != audioPath, // still image when paths are different
|
|
|
|
scanKind); |
|
|
|
scanKind) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
HasMultipleProfiles = hasMultipleProfiles |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var videoInputFile = new VideoInputFile( |
|
|
|
var videoInputFile = new VideoInputFile( |
|
|
|
videoPath, |
|
|
|
videoPath, |
|
|
|
@ -405,8 +418,6 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService |
|
|
|
graphicsElementContexts.AddRange(watermarks.Map(wm => new WatermarkElementContext(wm))); |
|
|
|
graphicsElementContexts.AddRange(watermarks.Map(wm => new WatermarkElementContext(wm))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
HardwareAccelerationMode hwAccel = GetHardwareAccelerationMode(playbackSettings); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string videoFormat = GetVideoFormat(playbackSettings); |
|
|
|
string videoFormat = GetVideoFormat(playbackSettings); |
|
|
|
Option<string> maybeVideoProfile = GetVideoProfile(videoFormat, channel.FFmpegProfile.VideoProfile); |
|
|
|
Option<string> maybeVideoProfile = GetVideoProfile(videoFormat, channel.FFmpegProfile.VideoProfile); |
|
|
|
Option<string> maybeVideoPreset = GetVideoPreset( |
|
|
|
Option<string> maybeVideoPreset = GetVideoPreset( |
|
|
|
@ -652,6 +663,19 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private async Task<bool> ProbeHasMultipleProfiles( |
|
|
|
|
|
|
|
string ffmpegPath, |
|
|
|
|
|
|
|
MediaItem mediaItem, |
|
|
|
|
|
|
|
CancellationToken cancellationToken) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_logger.LogDebug("Will probe for h264 profile count"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Option<int> profileCount = |
|
|
|
|
|
|
|
await _localStatisticsProvider.GetProfileCount(ffmpegPath, mediaItem, cancellationToken); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await profileCount.IfNoneAsync(1) > 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<Command> ForError( |
|
|
|
public async Task<Command> ForError( |
|
|
|
string ffmpegPath, |
|
|
|
string ffmpegPath, |
|
|
|
Channel channel, |
|
|
|
Channel channel, |
|
|
|
|