|
|
|
@ -130,13 +130,18 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
var stream = new MediaStream
|
|
|
|
|
{
|
|
|
|
|
Codec = streamInfo.codec_name,
|
|
|
|
|
CodecTag = streamInfo.codec_tag_string,
|
|
|
|
|
Profile = streamInfo.profile,
|
|
|
|
|
Level = streamInfo.level,
|
|
|
|
|
Index = streamInfo.index,
|
|
|
|
|
PixelFormat = streamInfo.pix_fmt
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Filter out junk
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(streamInfo.codec_tag_string) && streamInfo.codec_tag_string.IndexOf("[0]", StringComparison.OrdinalIgnoreCase) == -1)
|
|
|
|
|
{
|
|
|
|
|
stream.CodecTag = streamInfo.codec_tag_string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (streamInfo.tags != null)
|
|
|
|
|
{
|
|
|
|
|
stream.Language = GetDictionaryValue(streamInfo.tags, "language");
|
|
|
|
@ -184,6 +189,11 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
|
|
|
|
|
// http://stackoverflow.com/questions/17353387/how-to-detect-anamorphic-video-with-ffprobe
|
|
|
|
|
stream.IsAnamorphic = string.Equals(streamInfo.sample_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
|
|
|
|
if (streamInfo.refs > 0)
|
|
|
|
|
{
|
|
|
|
|
stream.RefFrames = streamInfo.refs;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -922,9 +932,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
|
|
|
|
|
private void UpdateFromMediaInfo(MediaSourceInfo video, MediaStream videoStream)
|
|
|
|
|
{
|
|
|
|
|
if (video.Protocol == MediaProtocol.File)
|
|
|
|
|
{
|
|
|
|
|
if (videoStream != null)
|
|
|
|
|
if (video.Protocol == MediaProtocol.File && videoStream != null)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -935,7 +943,11 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
videoStream.IsCabac = result.IsCabac ?? videoStream.IsCabac;
|
|
|
|
|
videoStream.IsInterlaced = result.IsInterlaced ?? videoStream.IsInterlaced;
|
|
|
|
|
videoStream.BitDepth = result.BitDepth ?? videoStream.BitDepth;
|
|
|
|
|
videoStream.RefFrames = result.RefFrames;
|
|
|
|
|
videoStream.RefFrames = result.RefFrames ?? videoStream.RefFrames;
|
|
|
|
|
}
|
|
|
|
|
catch (TypeLoadException)
|
|
|
|
|
{
|
|
|
|
|
// This is non-essential. Don't spam the log
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -945,4 +957,3 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|