mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* lots of qsv fixes * update changelog * fix qsv mpeg2 * vaapi fixes * update changelog * upgrade mudblazor * fix bug with undefined input colorspacepull/1140/head
23 changed files with 279 additions and 95 deletions
@ -1,8 +1,27 @@
@@ -1,8 +1,27 @@
|
||||
namespace ErsatzTV.FFmpeg.Decoder.Qsv; |
||||
using ErsatzTV.FFmpeg.Format; |
||||
|
||||
namespace ErsatzTV.FFmpeg.Decoder.Qsv; |
||||
|
||||
public class DecoderHevcQsv : DecoderBase |
||||
{ |
||||
public override string Name => "hevc_qsv"; |
||||
|
||||
protected override FrameDataLocation OutputFrameDataLocation => FrameDataLocation.Hardware; |
||||
|
||||
public override FrameState NextState(FrameState currentState) |
||||
{ |
||||
FrameState nextState = base.NextState(currentState); |
||||
|
||||
return currentState.PixelFormat.Match( |
||||
pixelFormat => |
||||
{ |
||||
if (pixelFormat.BitDepth == 10) |
||||
{ |
||||
return nextState with { PixelFormat = new PixelFormatP010() }; |
||||
} |
||||
|
||||
return nextState with { PixelFormat = new PixelFormatNv12(pixelFormat.Name) }; |
||||
}, |
||||
() => nextState); |
||||
} |
||||
} |
||||
|
||||
@ -1,8 +1,27 @@
@@ -1,8 +1,27 @@
|
||||
namespace ErsatzTV.FFmpeg.Decoder.Qsv; |
||||
using ErsatzTV.FFmpeg.Format; |
||||
|
||||
namespace ErsatzTV.FFmpeg.Decoder.Qsv; |
||||
|
||||
public class DecoderVp9Qsv : DecoderBase |
||||
{ |
||||
public override string Name => "vp9_qsv"; |
||||
|
||||
protected override FrameDataLocation OutputFrameDataLocation => FrameDataLocation.Hardware; |
||||
|
||||
public override FrameState NextState(FrameState currentState) |
||||
{ |
||||
FrameState nextState = base.NextState(currentState); |
||||
|
||||
return currentState.PixelFormat.Match( |
||||
pixelFormat => |
||||
{ |
||||
if (pixelFormat.BitDepth == 10) |
||||
{ |
||||
return nextState with { PixelFormat = new PixelFormatP010() }; |
||||
} |
||||
|
||||
return nextState with { PixelFormat = new PixelFormatNv12(pixelFormat.Name) }; |
||||
}, |
||||
() => nextState); |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
using ErsatzTV.FFmpeg.Format; |
||||
|
||||
namespace ErsatzTV.FFmpeg.Encoder.Qsv; |
||||
|
||||
public class EncoderMpeg2Qsv : EncoderBase |
||||
{ |
||||
public override string Name => "mpeg2_qsv"; |
||||
public override StreamKind Kind => StreamKind.Video; |
||||
|
||||
public override IList<string> OutputOptions => |
||||
new[] { "-c:v", "mpeg2_qsv", "-low_power", "0", "-look_ahead", "0" }; |
||||
|
||||
public override FrameState NextState(FrameState currentState) => currentState with |
||||
{ |
||||
VideoFormat = VideoFormat.Mpeg2Video, |
||||
FrameDataLocation = FrameDataLocation.Hardware |
||||
}; |
||||
} |
||||
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
using ErsatzTV.FFmpeg.Format; |
||||
|
||||
namespace ErsatzTV.FFmpeg.Encoder.Vaapi; |
||||
|
||||
public class EncoderMpeg2Vaapi : EncoderBase |
||||
{ |
||||
public override string Name => "mpeg2_vaapi"; |
||||
public override StreamKind Kind => StreamKind.Video; |
||||
public override FrameState NextState(FrameState currentState) => currentState with |
||||
{ |
||||
VideoFormat = VideoFormat.Mpeg2Video |
||||
// don't change the frame data location
|
||||
}; |
||||
} |
||||
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
namespace ErsatzTV.FFmpeg.Format; |
||||
|
||||
public class PixelFormatP010 : IPixelFormat |
||||
{ |
||||
public string Name => "p010le"; |
||||
public string FFmpegName => "p010"; |
||||
public int BitDepth => 10; |
||||
} |
||||
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
namespace ErsatzTV.FFmpeg.Format; |
||||
|
||||
public class PixelFormatVaapi : IPixelFormat |
||||
{ |
||||
public PixelFormatVaapi(string name) => Name = name; |
||||
|
||||
public string Name { get; } |
||||
|
||||
public string FFmpegName => "vaapi"; |
||||
|
||||
public int BitDepth => 8; |
||||
} |
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Loading…
Reference in new issue