mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 06:23:03 +03:00
fixes #838 - Support rtmp protocol with channels
This commit is contained in:
@@ -1,22 +1,27 @@
|
||||
using MediaBrowser.Controller.MediaEncoding;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
public static class EncodingUtils
|
||||
{
|
||||
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||
|
||||
public static string GetInputArgument(List<string> inputFiles, bool isRemote)
|
||||
public static string GetInputArgument(List<string> inputFiles, MediaProtocol protocol)
|
||||
{
|
||||
if (isRemote)
|
||||
if (protocol == MediaProtocol.Http)
|
||||
{
|
||||
return GetHttpInputArgument(inputFiles);
|
||||
var url = inputFiles.First();
|
||||
|
||||
return string.Format("\"{0}\"", url);
|
||||
}
|
||||
if (protocol == MediaProtocol.Rtmp)
|
||||
{
|
||||
var url = inputFiles.First();
|
||||
|
||||
return string.Format("\"{0}\"", url);
|
||||
}
|
||||
|
||||
return GetConcatInputArgument(inputFiles);
|
||||
@@ -52,35 +57,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
return string.Format("file:\"{0}\"", path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the HTTP input argument.
|
||||
/// </summary>
|
||||
/// <param name="inputFiles">The input files.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private static string GetHttpInputArgument(IEnumerable<string> inputFiles)
|
||||
{
|
||||
var url = inputFiles.First();
|
||||
|
||||
return string.Format("\"{0}\"", url);
|
||||
}
|
||||
|
||||
private static string GetFastSeekValue(EncodingOptions options)
|
||||
{
|
||||
var time = options.StartTimeTicks;
|
||||
|
||||
if (time.HasValue)
|
||||
{
|
||||
var seconds = TimeSpan.FromTicks(time.Value).TotalSeconds;
|
||||
|
||||
if (seconds > 0)
|
||||
{
|
||||
return string.Format("-ss {0}", seconds.ToString(UsCulture));
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public static string GetProbeSizeArgument(bool isDvd)
|
||||
{
|
||||
return isDvd ? "-probesize 1G -analyzeduration 200M" : string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user