Ejemplo n.º 1
0
 private static Subtitle GetXmlSubtitle(FF.Stream stream)
 => new Subtitle()
 {
     CodecName     = stream.codec_name,
     CodecLongName = stream.codec_long_name,
     Language      = stream.tag.GetLanguage(),
     Title         = stream.tag.GetTitle()
 };
Ejemplo n.º 2
0
 private static Video GetXmlVideo(FF.Stream stream)
 => new Video()
 {
     CodecName     = stream.codec_name,
     CodecLongName = stream.codec_long_name,
     AspectRatio   = GetAspectRatio(stream),
     Language      = stream.tag.GetLanguage(),
     Title         = stream.tag.GetTitle(),
 };
Ejemplo n.º 3
0
 private static Audio GetXmlAudio(FF.Stream stream)
 => new Audio()
 {
     CodecName     = stream.codec_name,
     CodecLongName = stream.codec_long_name,
     SampleRate    = stream.sample_rate,
     Channels      = stream.channels,
     ChannelLayout = stream.channel_layout,
     Language      = stream.tag.GetLanguage(),
     Title         = stream.tag.GetTitle(),
 };
Ejemplo n.º 4
0
        private static AspectRatio GetAspectRatio(FF.Stream stream)
        {
            var ratio = new AspectRatio()
            {
                Width       = stream.width,
                Height      = stream.height,
                CodedWidth  = stream.coded_width,
                CodedHeight = stream.coded_height,
                Ratio       = GetAspectRatio(stream.display_aspect_ratio),
            };

            ratio.CodedWidthSpecified  = ratio.CodedWidth != 0 && ratio.Width != ratio.CodedWidth;
            ratio.CodedHeightSpecified = ratio.CodedHeight != 0 && ratio.Height != ratio.CodedHeight;

            if ((ratio.Ratio == 0) && (ratio.Height > 0))
            {
                ratio.Ratio = CalulateRatio(ratio.Width, ratio.Height);
            }

            ratio.RatioSpecified = ratio.Ratio > 0;

            return(ratio);
        }
Ejemplo n.º 5
0
 private static bool IsVideo(FF.Stream stream)
 => stream?.codec_type == "video";
Ejemplo n.º 6
0
 private static bool IsAudio(FF.Stream stream)
 => stream?.codec_type == "audio";
Ejemplo n.º 7
0
 private static bool IsSubtile(FF.Stream stream)
 => stream?.codec_type == "subtitle";