mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
extract key frame info
This commit is contained in:
parent
2a681f205a
commit
3a00f003f5
@ -238,21 +238,23 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
|
|
||||||
if (extractKeyFrameInterval && mediaInfo.RunTimeTicks.HasValue)
|
if (extractKeyFrameInterval && mediaInfo.RunTimeTicks.HasValue)
|
||||||
{
|
{
|
||||||
foreach (var stream in mediaInfo.MediaStreams.Where(i => i.Type == MediaStreamType.Video)
|
foreach (var stream in mediaInfo.MediaStreams)
|
||||||
.ToList())
|
|
||||||
{
|
{
|
||||||
try
|
if (stream.Type == MediaStreamType.Video && string.Equals(stream.Codec, "h264", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
stream.KeyFrames = await GetKeyFrames(inputPath, stream.Index, cancellationToken)
|
try
|
||||||
.ConfigureAwait(false);
|
{
|
||||||
}
|
stream.KeyFrames = await GetKeyFrames(inputPath, stream.Index, cancellationToken)
|
||||||
catch (OperationCanceledException)
|
.ConfigureAwait(false);
|
||||||
{
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
}
|
{
|
||||||
catch (Exception ex)
|
|
||||||
{
|
}
|
||||||
_logger.ErrorException("Error getting key frame interval", ex);
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.ErrorException("Error getting key frame interval", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user