|
|
|
@ -63,7 +63,8 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
|
|
|
|
|
|
|
|
public class DynamicHlsService : BaseHlsService
|
|
|
|
|
{
|
|
|
|
|
public DynamicHlsService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, ILiveTvManager liveTvManager, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IProcessManager processManager, IMediaSourceManager mediaSourceManager, INetworkManager networkManager) : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, liveTvManager, dlnaManager, subtitleEncoder, deviceManager, processManager, mediaSourceManager)
|
|
|
|
|
public DynamicHlsService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, ILiveTvManager liveTvManager, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IProcessManager processManager, IMediaSourceManager mediaSourceManager, INetworkManager networkManager)
|
|
|
|
|
: base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, liveTvManager, dlnaManager, subtitleEncoder, deviceManager, processManager, mediaSourceManager)
|
|
|
|
|
{
|
|
|
|
|
NetworkManager = networkManager;
|
|
|
|
|
}
|
|
|
|
@ -206,7 +207,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
FileSystem.DeleteFile(file.FullName);
|
|
|
|
@ -676,22 +677,36 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
|
|
|
// If isEncoding is true we're actually starting ffmpeg
|
|
|
|
|
var startNumberParam = isEncoding ? GetStartNumber(state).ToString(UsCulture) : "0";
|
|
|
|
|
|
|
|
|
|
var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d.ts";
|
|
|
|
|
|
|
|
|
|
var args = string.Format("{0} {1} -map_metadata -1 -threads {2} {3} {4} -copyts -flags -global_header {5} -f segment -segment_time {6} -segment_start_number {7} -segment_list \"{8}\" -y \"{9}\"",
|
|
|
|
|
inputModifier,
|
|
|
|
|
GetInputArgument(transcodingJobId, state),
|
|
|
|
|
threads,
|
|
|
|
|
GetMapArgs(state),
|
|
|
|
|
GetVideoArguments(state),
|
|
|
|
|
GetAudioArguments(state),
|
|
|
|
|
state.SegmentLength.ToString(UsCulture),
|
|
|
|
|
startNumberParam,
|
|
|
|
|
outputPath,
|
|
|
|
|
outputTsArg
|
|
|
|
|
).Trim();
|
|
|
|
|
|
|
|
|
|
return args;
|
|
|
|
|
if (state.EnableGenericHlsSegmenter)
|
|
|
|
|
{
|
|
|
|
|
var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d.ts";
|
|
|
|
|
|
|
|
|
|
return string.Format("{0} {1} -map_metadata -1 -threads {2} {3} {4} -copyts -flags -global_header {5} -f segment -segment_time {6} -segment_start_number {7} -segment_list \"{8}\" -y \"{9}\"",
|
|
|
|
|
inputModifier,
|
|
|
|
|
GetInputArgument(transcodingJobId, state),
|
|
|
|
|
threads,
|
|
|
|
|
GetMapArgs(state),
|
|
|
|
|
GetVideoArguments(state),
|
|
|
|
|
GetAudioArguments(state),
|
|
|
|
|
state.SegmentLength.ToString(UsCulture),
|
|
|
|
|
startNumberParam,
|
|
|
|
|
outputPath,
|
|
|
|
|
outputTsArg
|
|
|
|
|
).Trim();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return string.Format("{0} {1} -map_metadata -1 -threads {2} {3} {4} -copyts -flags -global_header {5} -hls_time {6} -start_number {7} -hls_list_size {8} -y \"{9}\"",
|
|
|
|
|
inputModifier,
|
|
|
|
|
GetInputArgument(transcodingJobId, state),
|
|
|
|
|
threads,
|
|
|
|
|
GetMapArgs(state),
|
|
|
|
|
GetVideoArguments(state),
|
|
|
|
|
GetAudioArguments(state),
|
|
|
|
|
state.SegmentLength.ToString(UsCulture),
|
|
|
|
|
startNumberParam,
|
|
|
|
|
state.HlsListSize.ToString(UsCulture),
|
|
|
|
|
outputPath
|
|
|
|
|
).Trim();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|