The Free Software Media System - Server Backend & API
extract key frame info
Luke Pulverenti3a00f003f52f
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.csindex 06e3016b9b..7c4160e1ba 100644--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs@@ -238,21 +238,23 @@ namespace MediaBrowser.MediaEncoding.Encoderif (extractKeyFrameInterval && mediaInfo.RunTimeTicks.HasValue){- foreach (var stream in mediaInfo.MediaStreams.Where(i => i.Type == MediaStreamType.Video)- .ToList())+ foreach (var stream in mediaInfo.MediaStreams){- try+ if (stream.Type == MediaStreamType.Video && string.Equals(stream.Codec, "h264", StringComparison.OrdinalIgnoreCase)){- stream.KeyFrames = await GetKeyFrames(inputPath, stream.Index, cancellationToken)- .ConfigureAwait(false);- }- catch (OperationCanceledException)- {-- }- catch (Exception ex)- {- _logger.ErrorException("Error getting key frame interval", ex);+ try+ {+ stream.KeyFrames = await GetKeyFrames(inputPath, stream.Index, cancellationToken)+ .ConfigureAwait(false);+ }+ catch (OperationCanceledException)+ {++ }+ catch (Exception ex)+ {+ _logger.ErrorException("Error getting key frame interval", ex);+ }}}}