Пример #1
0
        public IFFprobeValue Get(FFprobeCodecTypes ffprobeCodecType, int streamIndex, string key)
        {
            var streamResultItems = Results.Where(r => r.Type == "STREAM").ToList();

            if (!streamResultItems.Any())
            {
                return(null);
            }

            var codecTypeObject  = FFprobeObject.Create(ffprobeCodecType.ToString().ToLower());
            var codecResultItems = Results.Where(r => r.ValuePairs.Any(vp => vp.Key == "codec_type" && vp.Value.Equals(codecTypeObject))).ToList();

            if (!codecResultItems.Any())
            {
                return(null);
            }

            if (codecResultItems.Count <= streamIndex)
            {
                return(null);
            }

            var streamData      = codecResultItems.ElementAt(streamIndex);
            var streamDataValue = streamData.ValuePairs.FirstOrDefault(vp => vp.Key == key);

            return(streamDataValue == null ? null : streamDataValue.Value);
        }
        public IFFprobeValue Get(FFprobeCodecTypes ffprobeCodecType, int streamIndex, string key)
        {
            var streamResultItems = Results.Where(r => r.Type == "STREAM").ToList();
            if (!streamResultItems.Any())
            {
                return null;
            }

            var codecTypeObject = FFprobeObject.Create(ffprobeCodecType.ToString().ToLower());
            var codecResultItems = Results.Where(r => r.ValuePairs.Any(vp => vp.Key == "codec_type" && vp.Value.Equals(codecTypeObject))).ToList();
            if (!codecResultItems.Any())
            {
                return null;
            }

            if (codecResultItems.Count <= streamIndex)
            {
                return null;
            }

            var streamData = codecResultItems.ElementAt(streamIndex);
            var streamDataValue = streamData.ValuePairs.FirstOrDefault(vp => vp.Key == key);

            return streamDataValue == null ? null : streamDataValue.Value;
        }
        public int GetCount(FFprobeCodecTypes ffprobeCodecType)
        {
            var streamResultItems = Results.Where(r => r.Type == "STREAM").ToList();
            if (!streamResultItems.Any())
            {
                return 0;
            }

            var codecTypeObject = FFprobeObject.Create(ffprobeCodecType.ToString().ToLower());
            var codecResultItems = Results.Where(r => r.ValuePairs.Any(vp => vp.Key == "codec_type" && vp.Value.Equals(codecTypeObject))).ToList();
            return codecResultItems.Count;
        }
Пример #4
0
        public int GetCount(FFprobeCodecTypes ffprobeCodecType)
        {
            var streamResultItems = Results.Where(r => r.Type == "STREAM").ToList();

            if (!streamResultItems.Any())
            {
                return(0);
            }

            var codecTypeObject  = FFprobeObject.Create(ffprobeCodecType.ToString().ToLower());
            var codecResultItems = Results.Where(r => r.ValuePairs.Any(vp => vp.Key == "codec_type" && vp.Value.Equals(codecTypeObject))).ToList();

            return(codecResultItems.Count);
        }