diff options
Diffstat (limited to 'MediaBrowser.Api/Playback/Progressive/VideoService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/Progressive/VideoService.cs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs index f82de5a6a..5ef72a495 100644 --- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs +++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs @@ -32,6 +32,7 @@ namespace MediaBrowser.Api.Playback.Progressive [Route("/Videos/{Id}/stream.3gp", "GET")] [Route("/Videos/{Id}/stream.wmv", "GET")] [Route("/Videos/{Id}/stream.wtv", "GET")] + [Route("/Videos/{Id}/stream.mov", "GET")] [Route("/Videos/{Id}/stream", "GET")] [Route("/Videos/{Id}/stream.ts", "HEAD")] [Route("/Videos/{Id}/stream.webm", "HEAD")] @@ -48,6 +49,7 @@ namespace MediaBrowser.Api.Playback.Progressive [Route("/Videos/{Id}/stream.wmv", "HEAD")] [Route("/Videos/{Id}/stream.wtv", "HEAD")] [Route("/Videos/{Id}/stream.m2ts", "HEAD")] + [Route("/Videos/{Id}/stream.mov", "HEAD")] [Route("/Videos/{Id}/stream", "HEAD")] [Api(Description = "Gets a video stream")] public class GetVideoStream : VideoStreamRequest @@ -101,7 +103,7 @@ namespace MediaBrowser.Api.Playback.Progressive var inputModifier = GetInputModifier(state); - return string.Format("{0} -i {1}{2} {3} {4} -map_metadata -1 -threads {5} {6}{7} -y \"{8}\"", + return string.Format("{0} {1}{2} {3} {4} -map_metadata -1 -threads {5} {6}{7} -y \"{8}\"", inputModifier, GetInputArgument(transcodingJobId, state), keyFrame, @@ -122,7 +124,7 @@ namespace MediaBrowser.Api.Playback.Progressive /// <returns>System.String.</returns> private string GetVideoArguments(StreamState state, string codec) { - var args = "-vcodec " + codec; + var args = "-codec:v:0 " + codec; if (state.EnableMpegtsM2TsMode) { @@ -132,8 +134,9 @@ namespace MediaBrowser.Api.Playback.Progressive // See if we can save come cpu cycles by avoiding encoding if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase)) { - // TODO: Switch to -bsf dump_extra ? - return state.VideoStream != null && IsH264(state.VideoStream) ? args + " -bsf h264_mp4toannexb" : args; + return state.VideoStream != null && IsH264(state.VideoStream) && string.Equals(state.OutputContainer, "ts", StringComparison.OrdinalIgnoreCase) ? + args + " -bsf:v h264_mp4toannexb" : + args; } var keyFrameArg = string.Format(" -force_key_frames expr:gte(t,n_forced*{0})", @@ -181,13 +184,13 @@ namespace MediaBrowser.Api.Playback.Progressive // Get the output codec name var codec = state.OutputAudioCodec; + var args = "-codec:a:0 " + codec; + if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase)) { - return "-acodec copy"; + return args; } - var args = "-acodec " + codec; - // Add the number of audio channels var channels = state.OutputAudioChannels; |
