added profile and level params for hls

This commit is contained in:
Luke Pulverenti 2013-03-28 10:42:03 -04:00
parent 81152d9e41
commit 071e13fb4c
2 changed files with 26 additions and 2 deletions

View File

@ -8,14 +8,14 @@ using ServiceStack.ServiceHost;
namespace MediaBrowser.Api.Playback.Hls
{
[Route("/Videos/{Id}/stream.m3u8", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets a video stream using HTTP live streaming.")]
[Api(Description = "Gets a video stream using HTTP live streaming.")]
public class GetHlsVideoStream : VideoStreamRequest
{
}
[Route("/Videos/{Id}/segments/{SegmentId}/stream.ts", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets an Http live streaming segment file. Internal use only.")]
[Api(Description = "Gets an Http live streaming segment file. Internal use only.")]
public class GetHlsVideoSegment
{
public string Id { get; set; }
@ -154,6 +154,16 @@ namespace MediaBrowser.Api.Playback.Hls
args += " -vsync vfr";
if (!string.IsNullOrEmpty(state.VideoRequest.Profile))
{
args += " -profile:v " + state.VideoRequest.Profile;
}
if (!string.IsNullOrEmpty(state.VideoRequest.Level))
{
args += " -level 3 " + state.VideoRequest.Level;
}
if (state.SubtitleStream != null)
{
// This is for internal graphical subs

View File

@ -135,5 +135,19 @@ namespace MediaBrowser.Api.Playback
/// <value>The framerate.</value>
[ApiMember(Name = "Framerate", Description = "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", IsRequired = false, DataType = "double", ParameterType = "query", Verb = "GET")]
public double? Framerate { get; set; }
/// <summary>
/// Gets or sets the profile.
/// </summary>
/// <value>The profile.</value>
[ApiMember(Name = "Profile", Description = "Optional. Specify a specific h264 profile, e.g. main, baseline, high.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string Profile { get; set; }
/// <summary>
/// Gets or sets the level.
/// </summary>
/// <value>The level.</value>
[ApiMember(Name = "Level", Description = "Optional. Specify a level for the h264 profile, e.g. 3, 3.1.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string Level { get; set; }
}
}