detect anamorphic video

This commit is contained in:
Luke Pulverenti
2014-06-22 12:25:47 -04:00
parent 414b1251c7
commit 3b30a2aee0
23 changed files with 182 additions and 37 deletions

View File

@@ -1788,7 +1788,8 @@ namespace MediaBrowser.Api.Playback
state.TargetVideoLevel,
state.TargetFramerate,
state.TargetPacketLength,
state.TargetTimestamp);
state.TargetTimestamp,
state.IsTargetAnamorphic);
if (mediaProfile != null)
{
@@ -1885,7 +1886,8 @@ namespace MediaBrowser.Api.Playback
state.TargetVideoLevel,
state.TargetFramerate,
state.TargetPacketLength,
state.TranscodeSeekInfo
state.TranscodeSeekInfo,
state.IsTargetAnamorphic
);
}

View File

@@ -313,7 +313,7 @@ namespace MediaBrowser.Api.Playback.Hls
// See if we can save come cpu cycles by avoiding encoding
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
{
return IsH264(state.VideoStream) ? "-codec:v:0 copy -bsf h264_mp4toannexb" : "-codec:v:0 copy";
return IsH264(state.VideoStream) ? "-codec:v:0 copy -bsf h264_mp4toannexb -bsf dump_extra" : "-codec:v:0 copy";
}
var keyFrameArg = state.ReadInputAtNativeFramerate ?

View File

@@ -160,7 +160,7 @@ namespace MediaBrowser.Api.Playback.Hls
// See if we can save come cpu cycles by avoiding encoding
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
{
return IsH264(state.VideoStream) ? "-codec:v:0 copy -bsf h264_mp4toannexb" : "-codec:v:0 copy";
return IsH264(state.VideoStream) ? "-codec:v:0 copy -bsf h264_mp4toannexb -bsf dump_extra" : "-codec:v:0 copy";
}
var keyFrameArg = state.ReadInputAtNativeFramerate ?

View File

@@ -140,7 +140,7 @@ namespace MediaBrowser.Api.Playback.Progressive
// See if we can save come cpu cycles by avoiding encoding
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
{
return state.VideoStream != null && IsH264(state.VideoStream) ? args + " -bsf h264_mp4toannexb" : args;
return state.VideoStream != null && IsH264(state.VideoStream) ? args + " -bsf h264_mp4toannexb -bsf dump_extra" : args;
}
const string keyFrameArg = " -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5))";

View File

@@ -2,7 +2,6 @@
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
@@ -330,5 +329,17 @@ namespace MediaBrowser.Api.Playback
}
}
public bool? IsTargetAnamorphic
{
get
{
if (Request.Static)
{
return VideoStream == null ? null : VideoStream.IsAnamorphic;
}
return false;
}
}
}
}