public AudioStreamInfo(Dictionary <string, object> dict) : base(dict) { SampleFmt = AdditionalAttributes.GetValueAndRemove("sample_fmt")?.ToString(); SampleRate = AdditionalAttributes.ContainsKey("sample_rate") ? Convert.ToDouble(new Expression(AdditionalAttributes.GetValueAndRemove("sample_rate").ToString()).Evaluate()) : (double?)null; Channels = AdditionalAttributes.ContainsKey("channels") ? Convert.ToInt32(AdditionalAttributes.GetValueAndRemove("channels")) : (int?)null; ChannelLayout = AdditionalAttributes.GetValueAndRemove("channel_layout")?.ToString(); BitsPerSample = AdditionalAttributes.ContainsKey("bits_per_sample") ? Convert.ToInt32(AdditionalAttributes.GetValueAndRemove("bits_per_sample")) : (int?)null; }
public VideoStreamInfo(Dictionary <string, object> dict) : base(dict) { Profile = AdditionalAttributes.GetValueAndRemove("profile")?.ToString(); Width = AdditionalAttributes.ContainsKey("width") ? Convert.ToInt32(AdditionalAttributes.GetValueAndRemove("width")) : (int?)null; Height = AdditionalAttributes.ContainsKey("height") ? Convert.ToInt32(AdditionalAttributes.GetValueAndRemove("height")) : (int?)null; CodedWidth = AdditionalAttributes.ContainsKey("coded_width") ? Convert.ToInt32(AdditionalAttributes.GetValueAndRemove("coded_width")) : (int?)null; CodedHeight = AdditionalAttributes.ContainsKey("coded_height") ? Convert.ToInt32(AdditionalAttributes.GetValueAndRemove("coded_height")) : (int?)null; HasBFrames = AdditionalAttributes.ContainsKey("has_b_frames") ? Convert.ToBoolean(AdditionalAttributes.GetValueAndRemove("has_b_frames")) : (bool?)null; SampleAspectRatio = AdditionalAttributes.GetValueAndRemove("sample_aspect_ratio")?.ToString(); DisplayAspectRatio = AdditionalAttributes.GetValueAndRemove("display_aspect_ratio")?.ToString(); PixFmt = AdditionalAttributes.GetValueAndRemove("pix_fmt")?.ToString(); Level = AdditionalAttributes.ContainsKey("level") ? Convert.ToInt32(AdditionalAttributes.GetValueAndRemove("level")) : (int?)null; Refs = AdditionalAttributes.ContainsKey("refs") ? Convert.ToInt32(AdditionalAttributes.GetValueAndRemove("refs")) : (int?)null; }