Пример #1
0
        public void ReadAudio(FFprobeSerializerResult ffprobeSerializerResult)
        {
            AudioStream = FFprobeAudioStream.Create();

            double d;
            var    fd = ffprobeSerializerResult.Get(FFprobeCodecTypes.Audio, 0, "duration") as FFprobeObject;

            if (fd != null && double.TryParse(fd.Value.ToString(), out d))
            {
                AudioStream.Duration = TimeSpan.FromSeconds(d);
            }

            long br;
            var  fbr = ffprobeSerializerResult.Get(FFprobeCodecTypes.Audio, 0, "bit_rate") as FFprobeObject;

            if (fbr != null && long.TryParse(fbr.Value.ToString(), out br))
            {
                AudioStream.BitRate = br;
            }

            var tb = ffprobeSerializerResult.Get(FFprobeCodecTypes.Audio, 0, "time_base") as FFprobeFraction;

            if (tb != null)
            {
                AudioStream.TimeBase = tb;
            }
        }
Пример #2
0
 internal static MetadataInfo Create(FFprobeAudioStream loader)
 {
     return new MetadataInfo
     {
         HasAudio = true,
         HasVideo = false,
         BitRate = loader.BitRate,
         Duration = loader.Duration,
         Timebase = FFmpegFraction.Create(loader.TimeBase),
     };
 }