mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
using ErsatzTV.FFmpeg.Format; |
|
|
|
namespace ErsatzTV.FFmpeg.Encoder; |
|
|
|
public class EncoderLibx264(Option<string> maybeVideoProfile, Option<string> maybeVideoPreset) : EncoderBase |
|
{ |
|
public override string Name => "libx264"; |
|
public override StreamKind Kind => StreamKind.Video; |
|
|
|
public override string[] OutputOptions |
|
{ |
|
get |
|
{ |
|
var result = new List<string>(base.OutputOptions); |
|
|
|
foreach (string videoProfile in maybeVideoProfile) |
|
{ |
|
result.Add("-profile:v"); |
|
result.Add(videoProfile.ToLowerInvariant()); |
|
} |
|
|
|
foreach (string videoPreset in maybeVideoPreset) |
|
{ |
|
if (!string.IsNullOrWhiteSpace(videoPreset)) |
|
{ |
|
result.Add("-preset:v"); |
|
result.Add(videoPreset); |
|
} |
|
} |
|
|
|
return result.ToArray(); |
|
} |
|
} |
|
|
|
public override FrameState NextState(FrameState currentState) => |
|
currentState with { VideoFormat = VideoFormat.H264 }; |
|
}
|
|
|