diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-13 22:24:35 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-13 22:24:35 -0400 |
| commit | cbfc2ac368bf079d423828ce8787ceb77aa943d7 (patch) | |
| tree | 34918cb80aa495b581536adc885e879a1a03996a | |
| parent | caffc4c3ec6a8e575b7f43641243e5fe7d169ee9 (diff) | |
more video improvements
| -rw-r--r-- | MediaBrowser.Api/HttpHandlers/VideoHandler.cs | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/VideoHandler.cs b/MediaBrowser.Api/HttpHandlers/VideoHandler.cs index c767335bb..32ba45ede 100644 --- a/MediaBrowser.Api/HttpHandlers/VideoHandler.cs +++ b/MediaBrowser.Api/HttpHandlers/VideoHandler.cs @@ -18,7 +18,10 @@ namespace MediaBrowser.Api.HttpHandlers {
get
{
- return new string[] { "mp4", "wmv", "3gp", "avi", "ogv", "mov", "m4v", "mkv" };
+ // mp4, 3gp, mov - muxer does not support non-seekable output
+ // avi, mov, mkv, m4v - can't stream these when encoding. the player will try to download them completely before starting playback.
+ // wmv - can't seem to figure out the output format name
+ return new string[] { "mp4", "3gp", "m4v", "mkv", "avi", "mov", "wmv" };
}
}
@@ -145,6 +148,14 @@ namespace MediaBrowser.Api.HttpHandlers {
return "wmv2";
}
+ else if (outputFormat.Equals("wmv"))
+ {
+ return "wmv2";
+ }
+ else if (outputFormat.Equals("ogv"))
+ {
+ return "libtheora";
+ }
return "libx264";
}
@@ -156,6 +167,18 @@ namespace MediaBrowser.Api.HttpHandlers // Per webm specification, it must be vorbis
return "libvorbis";
}
+ else if (outputFormat.Equals("asf"))
+ {
+ return "wmav2";
+ }
+ else if (outputFormat.Equals("wmv"))
+ {
+ return "wmav2";
+ }
+ else if (outputFormat.Equals("ogv"))
+ {
+ return "libvorbis";
+ }
// See if we can just copy the stream
if (HasBasicAudio(audioStream))
@@ -168,10 +191,18 @@ namespace MediaBrowser.Api.HttpHandlers private int? GetNumAudioChannelsParam(string audioCodec, int libraryItemChannels)
{
- if (libraryItemChannels > 2 && audioCodec.Equals("libvo_aacenc"))
+ if (libraryItemChannels > 2)
{
- // libvo_aacenc currently only supports two channel output
- return 2;
+ if (audioCodec.Equals("libvo_aacenc"))
+ {
+ // libvo_aacenc currently only supports two channel output
+ return 2;
+ }
+ else if (audioCodec.Equals("wmav2"))
+ {
+ // wmav2 currently only supports two channel output
+ return 2;
+ }
}
return GetNumAudioChannelsParam(libraryItemChannels);
@@ -179,11 +210,12 @@ namespace MediaBrowser.Api.HttpHandlers private bool HasBasicAudio(AudioStream audio)
{
- int maxChannels = AudioChannels ?? 2;
-
- if (audio.Channels > maxChannels)
+ if (AudioChannels.HasValue)
{
- return false;
+ if (audio.Channels > AudioChannels.Value)
+ {
+ return false;
+ }
}
if (audio.AudioFormat.IndexOf("aac", StringComparison.OrdinalIgnoreCase) != -1)
|
