Stream custom live channels using your own media
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.
 
 
 
 

35 lines
1.0 KiB

using ErsatzTV.FFmpeg.Environment;
using ErsatzTV.FFmpeg.Format;
namespace ErsatzTV.FFmpeg.Decoder;
public class DecoderAc3Downmix(int sourceChannels, int desiredChannels) : IDecoder
{
public string Name => "ac3";
public EnvironmentVariable[] EnvironmentVariables => [];
public string[] GlobalOptions => [];
public string[] FilterOptions => [];
public string[] OutputOptions => [];
public string[] InputOptions(InputFile inputFile)
{
if (sourceChannels >= 2 && desiredChannels == 2)
{
return ["-c:a", "ac3", "-downmix", AudioLayout.Stereo];
}
// unsupported downmix; hopefully the layout doesn't change
return [];
}
public FrameState NextState(FrameState currentState) => currentState;
public bool AppliesTo(AudioInputFile audioInputFile) => true;
public bool AppliesTo(VideoInputFile videoInputFile) => false;
public bool AppliesTo(ConcatInputFile concatInputFile) => false;
public bool AppliesTo(GraphicsEngineInput graphicsEngineInput) => false;
}