Fix segment_time_delta for ffmpeg 4.1

This commit is contained in:
Bond_009 2019-01-20 21:50:35 +01:00
parent 0586598d33
commit c27aff1c63

View File

@ -936,10 +936,10 @@ namespace MediaBrowser.Api.Playback.Hls
var timeDeltaParam = string.Empty;
if (isEncoding && startNumber > 0)
if (isEncoding && state.TargetFramerate > 0)
{
var startTime = state.SegmentLength * startNumber;
timeDeltaParam = string.Format("-segment_time_delta -{0}", startTime);
float startTime = 1 / (state.TargetFramerate.Value * 2);
timeDeltaParam = string.Format("-segment_time_delta {0}", Math.Round(startTime, 3));
}
var segmentFormat = GetSegmentFileExtension(state.Request).TrimStart('.');