예제 #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()
 };
예제 #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(),
 };
예제 #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(),
 };
예제 #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);
        }
예제 #5
0
 private static bool IsVideo(FF.Stream stream)
 => stream?.codec_type == "video";
예제 #6
0
 private static bool IsAudio(FF.Stream stream)
 => stream?.codec_type == "audio";
예제 #7
0
 private static bool IsSubtile(FF.Stream stream)
 => stream?.codec_type == "subtitle";