|
|
|
@ -27,12 +27,8 @@ namespace MediaBrowser.Controller.Providers
|
|
|
|
|
|
|
|
|
|
protected override void Fetch(Video video, FFProbeResult data)
|
|
|
|
|
{
|
|
|
|
|
if (data == null)
|
|
|
|
|
if (data.format != null)
|
|
|
|
|
{
|
|
|
|
|
Logger.LogInfo("Null FFProbeResult for {0} {1}", video.Id, video.Name);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(data.format.duration))
|
|
|
|
|
{
|
|
|
|
|
video.RunTimeTicks = TimeSpan.FromSeconds(double.Parse(data.format.duration)).Ticks;
|
|
|
|
@ -42,7 +38,10 @@ namespace MediaBrowser.Controller.Providers
|
|
|
|
|
{
|
|
|
|
|
video.BitRate = int.Parse(data.format.bit_rate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (data.streams != null)
|
|
|
|
|
{
|
|
|
|
|
// For now, only read info about first video stream
|
|
|
|
|
// Files with multiple video streams are possible, but extremely rare
|
|
|
|
|
bool foundVideo = false;
|
|
|
|
@ -64,6 +63,7 @@ namespace MediaBrowser.Controller.Providers
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FetchFromVideoStream(Video video, MediaStream stream)
|
|
|
|
|
{
|
|
|
|
@ -112,6 +112,17 @@ namespace MediaBrowser.Controller.Providers
|
|
|
|
|
video.AudioStreams = streams;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FetchFromSubtitleStream(Video video, MediaStream stream)
|
|
|
|
|
{
|
|
|
|
|
SubtitleStream subtitle = new SubtitleStream();
|
|
|
|
|
|
|
|
|
|
subtitle.Language = GetDictionaryValue(stream.tags, "language");
|
|
|
|
|
|
|
|
|
|
List<SubtitleStream> streams = video.Subtitles ?? new List<SubtitleStream>();
|
|
|
|
|
streams.Add(subtitle);
|
|
|
|
|
video.Subtitles = streams;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determines if there's already enough info in the Video object to allow us to skip running ffprobe
|
|
|
|
|
/// </summary>
|
|
|
|
|