diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-11-03 14:36:34 -0500 |
|---|---|---|
| committer | Joshua Boniface <joshua@boniface.me> | 2019-11-03 14:45:07 -0500 |
| commit | 7a592a0f15bfb2017234d80c3fa543fef17e332c (patch) | |
| tree | 58de550adffc88fa1372e0c2fe0b6912714b91c7 /MediaBrowser.Api/Playback/BaseStreamingService.cs | |
| parent | 1fad64cd59cef86bec5f768f563ed9a9e5d63e3e (diff) | |
Merge pull request #1904 from JustAMan/hls-move-2
Switch ffmpeg to hls muxer (from segment) to fix premature stop on non-patched ffmpeg
(cherry picked from commit a4608141820800a068561796de3fe4e7f20e5423)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 8c4ccfa22..7bfe0e0ce 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -289,17 +289,22 @@ namespace MediaBrowser.Api.Playback throw; } + Logger.LogDebug("Launched ffmpeg process"); state.TranscodingJob = transcodingJob; // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback _ = new JobLogger(Logger).StartStreamingLog(state, process.StandardError.BaseStream, logStream); // Wait for the file to exist before proceeeding - while (!File.Exists(state.WaitForPath ?? outputPath) && !transcodingJob.HasExited) + var ffmpegTargetFile = state.WaitForPath ?? outputPath; + Logger.LogDebug("Waiting for the creation of {0}", ffmpegTargetFile); + while (!File.Exists(ffmpegTargetFile) && !transcodingJob.HasExited) { await Task.Delay(100, cancellationTokenSource.Token).ConfigureAwait(false); } + Logger.LogDebug("File {0} created or transcoding has finished", ffmpegTargetFile); + if (state.IsInputVideo && transcodingJob.Type == TranscodingJobType.Progressive && !transcodingJob.HasExited) { await Task.Delay(1000, cancellationTokenSource.Token).ConfigureAwait(false); @@ -314,6 +319,7 @@ namespace MediaBrowser.Api.Playback { StartThrottler(state, transcodingJob); } + Logger.LogDebug("StartFfMpeg() finished successfully"); return transcodingJob; } |
