diff options
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 16 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/BifService.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Progressive/VideoService.cs | 3 |
3 files changed, 20 insertions, 4 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 3cb7b914a..bdd1b76d0 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1447,6 +1447,16 @@ namespace MediaBrowser.Api.Playback state.MediaPath = mediaUrl; state.InputProtocol = MediaProtocol.Http; } + else + { + // No media info, so this is probably needed + state.DeInterlace = true; + } + + if (recording.RecordingInfo.Status == RecordingStatus.InProgress) + { + state.ReadInputAtNativeFramerate = true; + } state.RunTimeTicks = recording.RunTimeTicks; @@ -1455,9 +1465,7 @@ namespace MediaBrowser.Api.Playback await Task.Delay(1000, cancellationToken).ConfigureAwait(false); } - state.ReadInputAtNativeFramerate = recording.RecordingInfo.Status == RecordingStatus.InProgress; state.OutputAudioSync = "1000"; - state.DeInterlace = true; state.InputVideoSync = "-1"; state.InputAudioSync = "1"; state.InputContainer = recording.Container; @@ -1524,7 +1532,9 @@ namespace MediaBrowser.Api.Playback state.RunTimeTicks = mediaSource.RunTimeTicks; } - if (string.Equals(state.InputContainer, "wtv", StringComparison.OrdinalIgnoreCase)) + // If it's a wtv and we don't have media info, we will probably need to deinterlace + if (string.Equals(state.InputContainer, "wtv", StringComparison.OrdinalIgnoreCase) && + mediaStreams.Count == 0) { state.DeInterlace = true; } diff --git a/MediaBrowser.Api/Playback/BifService.cs b/MediaBrowser.Api/Playback/BifService.cs index 7a3a7d32d..057d81441 100644 --- a/MediaBrowser.Api/Playback/BifService.cs +++ b/MediaBrowser.Api/Playback/BifService.cs @@ -72,6 +72,11 @@ namespace MediaBrowser.Api.Playback try { + if (File.Exists(path)) + { + return path; + } + await _mediaEncoder.ExtractVideoImagesOnInterval(inputPath, protocol, mediaSource.Video3DFormat, TimeSpan.FromSeconds(10), Path.GetDirectoryName(path), "img_", request.MaxWidth, CancellationToken.None) .ConfigureAwait(false); diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs index 937df513e..bedacc0d2 100644 --- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs +++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs @@ -144,7 +144,8 @@ namespace MediaBrowser.Api.Playback.Progressive return state.VideoStream != null && IsH264(state.VideoStream) ? args + " -bsf h264_mp4toannexb" : args; } - const string keyFrameArg = " -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5))"; + var keyFrameArg = string.Format(" -force_key_frames expr:gte(t,n_forced*{0})", + 5.ToString(UsCulture)); args += keyFrameArg; |
