Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     if (args.Length == 1)
     {
         string filePath = args[0];
         if (!File.Exists(filePath))
         {
             Environment.Exit(1);
             return;
         }
         MediaInfo mediaInfo = new MediaInfo();
         mediaInfo.Open(filePath);
         int imgCount   = mediaInfo.Count_Get(StreamKind.Image);
         int videoCount = mediaInfo.Count_Get(StreamKind.Video);
         Console.WriteLine(String.Format("Image count: {0}", imgCount));
         Console.WriteLine(String.Format("Video count: {0}", videoCount));
         if (imgCount > 0 || videoCount > 0)
         {
             Environment.Exit(0);
         }
         else
         {
             Environment.Exit(1);
         }
     }
     else
     {
         Environment.Exit(1);
     }
 }
Ejemplo n.º 2
0
 private void InitializeProperties(string path)
 {
     if (Path.GetExtension(path).ToLower() == ".avs")
     {
         this.AvisynthInfo(path);
     }
     else
     {
         MediaInfo info = new MediaInfo();
         info.Open(path);
         this._filePath = path;
         if (info.Count_Get(StreamKind.Video) > 0)
         {
             this._hasVideo  = true;
             this._format    = info.Get(StreamKind.Video, 0, "Format");
             this._container = info.Get(StreamKind.General, 0, "Format");
             string str  = info.Get(StreamKind.Audio, 0, "ID");
             string str2 = info.Get(StreamKind.Video, 0, "ID");
             int.TryParse(info.Get(StreamKind.Video, 0, "ID"), out this._mkvmergeId);
             if ((str == "0") || (str2 == "0"))
             {
                 this._ffmpegId = this._mkvmergeId;
             }
             else if ((str == "1") || (str2 == "1"))
             {
                 this._ffmpegId = this._mkvmergeId - 1;
             }
             double.TryParse(info.Get(StreamKind.Video, 0, "Duration"), out this._length);
             this._length /= (double)0x3e8;
             int.TryParse(info.Get(StreamKind.Video, 0, "Width", InfoKind.Text), out this._width);
             int.TryParse(info.Get(StreamKind.Video, 0, "Height", InfoKind.Text), out this._height);
             double.TryParse(info.Get(StreamKind.Video, 0, "FrameRate", InfoKind.Text), out this._frameRate);
             int.TryParse(info.Get(StreamKind.Video, 0, "FrameCount", InfoKind.Text), out this._frameCount);
             string str3 = info.Get(StreamKind.Video, 0, "DisplayAspectRatio/String", InfoKind.Text);
             if (str3.IndexOf(":") != -1)
             {
                 char[] separator = new char[] { ':' };
                 char[] chArray2  = new char[] { ':' };
                 this._displayAspectRatio = double.Parse(str3.Split(separator)[0]) / double.Parse(str3.Split(chArray2)[1]);
             }
             if ((this._width != 0) && (this._displayAspectRatio == 0))
             {
                 this._displayAspectRatio = ((double)this._width) / ((double)this._height);
             }
         }
         else
         {
             this._hasVideo = false;
         }
         this._audioStreamsCount = info.Count_Get(StreamKind.Audio);
         info.Close();
     }
 }
Ejemplo n.º 3
0
        private void getMediaInfo()
        {
            int VidTracks;
            int AudTracks;
            int SubTracks;

            MediaInfo MI = new MediaInfo();

            MI.Open(InputFileTextBox.Text);

            VidTracks = MI.Count_Get(StreamKind.Video);
            AudTracks = MI.Count_Get(StreamKind.Audio);
            SubTracks = MI.Count_Get(StreamKind.Text);

            VidTrackComboBox.Items.Clear();
            AudioTrackComboBox.Items.Clear();
            SubTrackComboBox.Items.Clear();
            AddVideoTracksToSelect(VidTracks);
            AddAudioTracksToSelect(AudTracks);
            if (SubTracks > 0)
            {
                AddSubTracksToSelect(SubTracks);
            }
            VidTrackComboBox.Visible   = true;
            AudioTrackComboBox.Visible = true;
            SubTrackComboBox.Visible   = true;

            MIVideoCodecSetLabel.Text = MI.Get(StreamKind.Video, 0, "Format");
            VidWidth  = int.Parse(MI.Get(StreamKind.Video, 0, "Width"));
            VidHeight = int.Parse(MI.Get(StreamKind.Video, 0, "Height"));
            MIVideoResSetLabel.Text   = VidWidth + "x" + VidHeight;
            MIVidBitrateSetLabel.Text = MI.Get(StreamKind.Video, 0, "BitRate/String");

            MIAudioCodecSetLabel.Text   = MI.Get(StreamKind.Audio, 0, "Format");
            MIAudioChanSetLabel.Text    = MI.Get(StreamKind.Audio, 0, "Channel(s)/String");
            MIAudioBitrateSetLabel.Text = MI.Get(StreamKind.Audio, 0, "BitRate/String");

            videoDuration     = int.Parse(MI.Get(StreamKind.General, 0, "Duration"));
            VideoRuntime.Text = MI.Get(StreamKind.General, 0, "Duration/String3");

            VidTrackCountSetLabel.Text    = VidTracks.ToString();
            AudioTracksCountSetLabel.Text = AudTracks.ToString();
            MISubTrackCountSetLabel.Text  = SubTracks.ToString();

            int AutoBitrate = CalcAutoBitrate(VidWidth, VidHeight);

            OutputBitrateTextBox.Text = AutoBitrate.ToString();

            MI.Close();
        }
Ejemplo n.º 4
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            //Test if version of DLL is compatible : 3rd argument is "version of DLL tested;Your application name;Your application version"
            String    ToDisplay;
            MediaInfo MI = new MediaInfo();

            ToDisplay = MI.Option("Info_Version", "0.7.0.0;MediaInfoDLL_Example_CS;0.7.0.0");
            if (ToDisplay.Length == 0)
            {
                richTextBox1.Text = "MediaInfo.Dll: this version of the DLL is not compatible";
                return;
            }

            //Information about MediaInfo
            ToDisplay += "\r\n\r\nInfo_Parameters\r\n";
            ToDisplay += MI.Option("Info_Parameters");

            ToDisplay += "\r\n\r\nInfo_Capacities\r\n";
            ToDisplay += MI.Option("Info_Capacities");

            ToDisplay += "\r\n\r\nInfo_Codecs\r\n";
            ToDisplay += MI.Option("Info_Codecs");

            //An example of how to use the library
            ToDisplay += "\r\n\r\nOpen\r\n";
            MI.Open("Example.ogg");

            ToDisplay += "\r\n\r\nInform with Complete=false\r\n";
            MI.Option("Complete");
            ToDisplay += MI.Inform();

            ToDisplay += "\r\n\r\nInform with Complete=true\r\n";
            MI.Option("Complete", "1");
            ToDisplay += MI.Inform();

            ToDisplay += "\r\n\r\nCustom Inform\r\n";
            MI.Option("Inform", "General;File size is %FileSize% bytes");
            ToDisplay += MI.Inform();

            ToDisplay += "\r\n\r\nGet with Stream=General and Parameter='FileSize'\r\n";
            ToDisplay += MI.Get(0, 0, "FileSize");

            ToDisplay += "\r\n\r\nGet with Stream=General and Parameter=46\r\n";
            ToDisplay += MI.Get(0, 0, 46);

            ToDisplay += "\r\n\r\nCount_Get with StreamKind=Stream_Audio\r\n";
            ToDisplay += MI.Count_Get(StreamKind.Audio);

            ToDisplay += "\r\n\r\nGet with Stream=General and Parameter='AudioCount'\r\n";
            ToDisplay += MI.Get(StreamKind.General, 0, "AudioCount");

            ToDisplay += "\r\n\r\nGet with Stream=Audio and Parameter='StreamCount'\r\n";
            ToDisplay += MI.Get(StreamKind.Audio, 0, "StreamCount");

            ToDisplay += "\r\n\r\nClose\r\n";
            MI.Close();

            //Displaying the text
            richTextBox1.Text = ToDisplay;
        }
Ejemplo n.º 5
0
        public static bool IsTranscodableFile(String filePath)
        {
            //using (var decoder = new Process()) {
            //	decoder.StartInfo = new ProcessStartInfo() {
            //		FileName = Path.Combine(Environment.CurrentDirectory, @"tools\ffmpeg\ffmpeg.exe"),
            //		Arguments = String.Format("-i \"{0}\" -acodec copy -v error -f null -", filePath),
            //		WindowStyle = ProcessWindowStyle.Hidden,
            //		CreateNoWindow = true,
            //		UseShellExecute = false,
            //		RedirectStandardInput = false,
            //		RedirectStandardOutput = false,
            //		RedirectStandardError = true
            //	};

            //	decoder.Start();
            //	var result = decoder.StandardError.ReadToEnd();

            //	return String.IsNullOrEmpty(result);
            //}

            using (var mediaInfo = new MediaInfo()) {
                mediaInfo.Open(filePath);
                var audioStreams = mediaInfo.Count_Get(StreamKind.Audio);

                return(audioStreams > 0);
            }
        }
Ejemplo n.º 6
0
        private Movie ExtractGeneralFileInformation(MediaInfo mi)
        {
            //var fileSize = mi.Get(0, 0, "FileSize");
            //var toDisplay = "\r\n\r\nGet with Stream=General and Parameter='FileSize'\r\n";
            //toDisplay += fileSize;

            //var generalStreamCount = mi.Count_Get(StreamKind.General);
            //toDisplay += "\r\n\r\nCount_Get with StreamKind=Stream_General\r\n";
            //toDisplay += generalStreamCount;

            //audioStreamCount = mi.Count_Get(StreamKind.Audio);
            //toDisplay += "\r\n\r\nCount_Get with StreamKind=Stream_Audio\r\n";
            //toDisplay += audioStreamCount;

            //videoStreamCount = mi.Count_Get(StreamKind.Video);
            //toDisplay += "\r\n\r\nCount_Get with StreamKind=Stream_Video\r\n";
            //toDisplay += videoStreamCount;

            //textStreamCount = mi.Count_Get(StreamKind.Text);
            //toDisplay += "\r\n\r\nCount_Get with StreamKind=Stream_Text\r\n";
            //toDisplay += textStreamCount;
            //Console.WriteLine("General, FrameRate: ", mi.Get(StreamKind.General, 0, "FrameRate"));
            //Console.WriteLine("Video, BitRate: ", mi.Get(StreamKind.Video, 0, "BitRate"));
            //Console.WriteLine("Audio, StreamSize: ", mi.Get(StreamKind.Audio, 0, "StreamSize"));
            //Console.WriteLine("Audio, StreamSize: ", mi.Get(StreamKind.Audio, 1, "StreamSize"));
            //Console.WriteLine("Audio, StreamSize: ", mi.Get(StreamKind.Audio, 2, "StreamSize"));
            var movie = new Movie
            {
                FileSize           = mi.Get(StreamKind.General, 0, "FileSize"),
                AudioStreamCount   = mi.Count_Get(StreamKind.Audio),
                VideoStreamCount   = mi.Count_Get(StreamKind.Video),
                TextStreamCount    = mi.Count_Get(StreamKind.Text),
                DurationMs         = mi.Get(StreamKind.General, 0, "Duration"),
                Duration           = mi.Get(StreamKind.General, 0, "Duration/String3"),
                Format             = mi.Get(StreamKind.General, 0, "Format"),
                FormatVersion      = mi.Get(StreamKind.General, 0, "Format_Version"),
                EncodedApplication = mi.Get(StreamKind.General, 0, "Encoded_Application"),
                EncodedLibrary     = mi.Get(StreamKind.General, 0, "Encoded_Library"),
                BitRateOverall     = mi.Get(StreamKind.General, 0, "OverallBitRate"),
                DateEncoded        = mi.Get(StreamKind.General, 0, "Encoded_Date"),
            };

            return(movie);
        }
Ejemplo n.º 7
0
 private void InitializeProperties(string path, int streamNum)
 {
     if (Path.GetExtension(path).ToLower() == ".avs")
     {
         this.AvisynthInfo(path);
     }
     else
     {
         MediaInfo info = new MediaInfo();
         info.Open(path);
         this._filePath = path;
         if (info.Count_Get(StreamKind.Audio) > 0)
         {
             this._format = info.Get(StreamKind.Audio, streamNum, "Format");
             string str  = info.Get(StreamKind.Audio, 0, "ID");
             string str2 = info.Get(StreamKind.Video, 0, "ID");
             int.TryParse(info.Get(StreamKind.Audio, streamNum, "ID"), out this._trackId);
             if ((str == "0") || (str2 == "0"))
             {
                 this._streamId = this._trackId;
             }
             else if ((str == "1") || (str2 == "1"))
             {
                 this._streamId = this._trackId - 1;
             }
             double.TryParse(info.Get(StreamKind.Audio, streamNum, "Duration"), out this._length);
             this._length      /= (double)0x3e8;
             this._streamsCount = info.Count_Get(StreamKind.Audio);
             if (info.Count_Get(StreamKind.Video) != 0)
             {
                 this._hasVideo = true;
             }
         }
         info.Close();
     }
 }
Ejemplo n.º 8
0
        private static eSubTitle DetectSubtitleType(string s)
        {
            var baseName = Path.Combine(Path.GetDirectoryName(s), Path.GetFileNameWithoutExtension(s));

            // text based subtitles

            string[] textSubtitleFormatsFileAndEmbedded =
            {
                "aqt",
                "srt",
                "ssa",
                "mpl",
                "txt",
                "dks",
                "js",
                "jss",
                "pjs",
                "asc",
                "ass",
                "smi",
                "psb",
                "lrc",
                "ovr",
                "rt",
                "rtf",
                "zeg",
                "sbt",
                "sst",
                "ssts",
                "stl",
                "vkt",
                "vsf",
                "pan",
                "s2k"
            };

            string[] imageSubtitleFormatsFile =
            {
                "idx",
                "sub",
                "scr",
                "son"
            };

            string[] imageSubtitleFormatsEmbedded =
            {
                "vobsub",
                "dvb subtitle",
                "pgs",
                "rle",
                "xsub",
            };

            // check for file based subtitles

            if (textSubtitleFormatsFileAndEmbedded.Any(subFormat => File.Exists(baseName + "." + subFormat)))
            {
                return(eSubTitle.TextBased);
            }

            if (imageSubtitleFormatsFile.Any(subFormat => File.Exists(baseName + "." + subFormat)))
            {
                return(eSubTitle.ImageBased);
            }

            // check for embedded subtitles

            var result = eSubTitle.None;
            var mi     = new MediaInfo();

            mi.Open(s);

            var sct = mi.Count_Get(StreamKind.Text);

            for (var i = 0; i < sct; ++i)
            {
                var format = mi.Get(StreamKind.Text, i, "Format").ToLowerInvariant();

                if (textSubtitleFormatsFileAndEmbedded.Contains(format))
                {
                    result = eSubTitle.TextBased;
                    break;
                }

                if (imageSubtitleFormatsEmbedded.Contains(format))
                {
                    result = eSubTitle.ImageBased;
                    break;
                }
            }

            mi.Close();
            return(result);
        }
        static void Main(string[] Args)
        {
            String    ToDisplay;
            MediaInfo MI = new MediaInfo();

            ToDisplay = MI.Option("Info_Version", "0.7.0.0;MediaInfoDLL_Example_CS;0.7.0.0");
            if (ToDisplay.Length == 0)
            {
                Console.Out.WriteLine("MediaInfo.Dll: this version of the DLL is not compatible");
                return;
            }

            //Information about MediaInfo
            ToDisplay += "\r\n\r\nInfo_Parameters\r\n";
            ToDisplay += MI.Option("Info_Parameters");

            ToDisplay += "\r\n\r\nInfo_Capacities\r\n";
            ToDisplay += MI.Option("Info_Capacities");

            ToDisplay += "\r\n\r\nInfo_Codecs\r\n";
            ToDisplay += MI.Option("Info_Codecs");

            //An example of how to use the library
            ToDisplay += "\r\n\r\nOpen\r\n";
            String File_Name;

            if (Args.Length == 0)
            {
                File_Name = "Example.ogg";
            }
            else
            {
                File_Name = Args[0];
            }
            MI.Open(File_Name);

            ToDisplay += "\r\n\r\nInform with Complete=false\r\n";
            MI.Option("Complete");
            ToDisplay += MI.Inform();

            ToDisplay += "\r\n\r\nInform with Complete=true\r\n";
            MI.Option("Complete", "1");
            ToDisplay += MI.Inform();

            ToDisplay += "\r\n\r\nCustom Inform\r\n";
            MI.Option("Inform", "General;File size is %FileSize% bytes");
            ToDisplay += MI.Inform();

            ToDisplay += "\r\n\r\nGet with Stream=General and Parameter='FileSize'\r\n";
            ToDisplay += MI.Get(0, 0, "FileSize");

            ToDisplay += "\r\n\r\nGet with Stream=General and Parameter=46\r\n";
            ToDisplay += MI.Get(0, 0, 46);

            ToDisplay += "\r\n\r\nCount_Get with StreamKind=Stream_Audio\r\n";
            ToDisplay += MI.Count_Get(StreamKind.Audio);

            ToDisplay += "\r\n\r\nGet with Stream=General and Parameter='AudioCount'\r\n";
            ToDisplay += MI.Get(StreamKind.General, 0, "AudioCount");

            ToDisplay += "\r\n\r\nGet with Stream=Audio and Parameter='StreamCount'\r\n";
            ToDisplay += MI.Get(StreamKind.Audio, 0, "StreamCount");

            ToDisplay += "\r\n\r\nClose\r\n";
            MI.Close();

            //Displaying the text
            Console.Out.WriteLine(ToDisplay);
        }
Ejemplo n.º 10
0
    public MediaInfoWrapper(string strFile) {
        if (strFile == null)
            return;

        bool isTV = Util.Utils.IsLiveTv(strFile);
        bool isRadio = Util.Utils.IsLiveRadio(strFile);
        bool isDVD = Util.Utils.IsDVD(strFile);
        bool isVideo = Util.Utils.IsVideo(strFile);
        bool isAVStream = Util.Utils.IsAVStream(strFile); //rtsp users for live TV and recordings.

        if (isTV || isRadio || isAVStream) {
            return;
        }

        try {
            _mI = new MediaInfo();
            _mI.Open(strFile);

            FileInfo fileInfo = strFile.PathToFileInfo();
            DriveInfo driveInfo = fileInfo.GetDriveInfo();

            if (strFile.ToLower().EndsWith(".ifo") && driveInfo != null && driveInfo.IsOptical())  {
                // mediainfo is not able to obtain duration of IFO files
                // so we use this to loop through all corresponding VOBs and add up the duration
                // we do not do this for optical drives because there are issues with some discs
                // taking more than 2 minutes(copy protection?)
                _duration = 0;
                string filePrefix = Path.GetFileName(strFile);
                filePrefix = filePrefix.Substring(0, filePrefix.LastIndexOf('_'));
                MediaInfo mi = new MediaInfo();
                foreach (string file in Directory.GetFiles(Path.GetDirectoryName(strFile), filePrefix + "*.VOB")) {
                    mi.Open(file);
                    int durationPart = 0;
                    int.TryParse(_mI.Get(StreamKind.Video, 0, "PlayTime"), out durationPart);
                    _duration += durationPart;
                }
            }
            else if (strFile.ToLowerInvariant().EndsWith(".bdmv") || strFile.ToLowerInvariant().EndsWith(".m2ts")) {
                bool result = GetLengthFromPlaylist(strFile);
                if (!result) {
                    //_duration = (int) currentPlaylistFile.TotalLength;
                    int.TryParse(_mI.Get(StreamKind.Video, 0, "PlayTime"), out _duration);
                }
            }
            else {
                int.TryParse(_mI.Get(StreamKind.Video, 0, "PlayTime"), out _duration);
            }

            NumberFormatInfo providerNumber = new NumberFormatInfo();
            providerNumber.NumberDecimalSeparator = ".";

            double.TryParse(_mI.Get(StreamKind.Video, 0, "FrameRate"), NumberStyles.AllowDecimalPoint, providerNumber, out _framerate);
            _videoCodec = _mI.Get(StreamKind.Video, 0, "Codec").ToLower();
            _scanType = _mI.Get(StreamKind.Video, 0, "ScanType").ToLower();
            int.TryParse(_mI.Get(StreamKind.Video, 0, "Width"), out _width);
            int.TryParse(_mI.Get(StreamKind.Video, 0, "Height"), out _height);
            int.TryParse(_mI.Get(StreamKind.Video, 0, "BitRate"), out _videoBitRate);
            int.TryParse(_mI.Get(StreamKind.Video, 0, "MultiView_Count"), out _multiViewCount);
            int.TryParse(_mI.Get(StreamKind.General, 0, "TextCount"), out _numSubtitles);

            int intValue;
            int iAudioStreams = _mI.Count_Get(StreamKind.Audio);
            for (int i = 0; i < iAudioStreams; i++) {
                string sChannels = Regex.Split(_mI.Get(StreamKind.Audio, i, "Channel(s)"), @"\D+").Max();

                if (int.TryParse(sChannels, out intValue) && intValue > _audioChannels) {
                    _audioChannels = intValue;
                    int.TryParse(_mI.Get(StreamKind.Audio, i, "SamplingRate"), out _audioSampleRate);
                    int.TryParse(_mI.Get(StreamKind.Audio, i, "BitRate"), out _audioBitRate);
                    _audioCodec = _mI.Get(StreamKind.Audio, i, "Codec/String").ToLower();
                    _audioFormatProfile = _mI.Get(StreamKind.Audio, i, "Format_Profile").ToLower();
                }
            }

            string aspectStr = _mI.Get(StreamKind.Video, 0, "AspectRatio/String");
            if (aspectStr == "4/3" || aspectStr == "4:3")
                _aspectRatio = "fullscreen";
            else
                _aspectRatio = "widescreen";

            _isInterlaced = (_scanType.IndexOf("interlaced") > -1);

            if (_height >= 720) {
                _isHDTV = true;
            }
            else {
                _isSDTV = true;
            }

            if ((_width == 1280 || _height == 720) && !_isInterlaced) {
                _is720P = true;
            }

            if ((_width == 1920 || _height == 1080) && !_isInterlaced) {
                _is1080P = true;
            }

            if ((_width == 1920 || _height == 1080) && _isInterlaced) {
                _is1080I = true;
            }

            if ((_width == 640 || _height == 480) && !_isInterlaced) {
                _is480P = true;
            }

            if ((_width == 640 || _height == 480) && _isInterlaced) {
                _is480I = true;
            }

            if ((_width == 720 || _width == 704 || _height == 576) && !_isInterlaced) {
                _is576P = true;
            }

            if ((_width == 720 || _width == 704 || _height == 576) && _isInterlaced) {
                _is576I = true;
            }

            if (_width == 3840 || _height == 2160) {
                _is2160P = true;
            }

            if (_width == 7680 || _height == 4320) {
                _is4320P = true;
            }

            _isDIVX = (_videoCodec.IndexOf("dx50") > -1) | (_videoCodec.IndexOf("div3") > -1); // DivX 5 and DivX 3
            _isXVID = (_videoCodec.IndexOf("xvid") > -1);
            _isH264 = (_videoCodec.IndexOf("avc") > -1 || _videoCodec.IndexOf("h264") > -1);
            _isMP1V = (_videoCodec.IndexOf("mpeg-1v") > -1);
            _isMP2V = (_videoCodec.IndexOf("mpeg-2v") > -1);
            _isMP4V = (_videoCodec.IndexOf("fmp4") > -1); // add more
            _isWMV = (_videoCodec.IndexOf("wmv") > -1); // wmv3 = WMV9
            // missing cvid etc
            _isAC3 = (System.Text.RegularExpressions.Regex.IsMatch(_audioCodec, "ac-?3"));
            _isMP3 = (_audioCodec.IndexOf("mpeg-1 audio layer 3") > -1) || (_audioCodec.IndexOf("mpeg-2 audio layer 3") > -1);
            _isMP2A = (_audioCodec.IndexOf("mpeg-1 audio layer 2") > -1);
            _isDTS = (_audioCodec.IndexOf("dts") > -1);
            _isOGG = (_audioCodec.IndexOf("ogg") > -1);
            _isAAC = (_audioCodec.IndexOf("aac") > -1);
            _isWMA = (_audioCodec.IndexOf("wma") > -1); // e.g. wma3
            _isPCM = (_audioCodec.IndexOf("pcm") > -1);
            _isTrueHD = (_audioCodec.Contains("truehd") || _audioFormatProfile.Contains("truehd"));
            _isDTSHD = (_audioCodec.Contains("dts") && (_audioFormatProfile.Contains("hra") || _audioFormatProfile.Contains("ma")));

            _is3D = (_multiViewCount > 1);

            if (checkHasExternalSubtitles(strFile)) {
                _hasSubtitles = true;
            }
            else if (_numSubtitles > 0) {
                _hasSubtitles = true;
            }
            else {
                _hasSubtitles = false;
            }

            _fileSize = fileInfo.Length;

            logger.Debug("MediaInfoWrapper: InspectingMedia: {0}", strFile);
            logger.Debug("MediaInfoWrapper: FrameRate: {0}", _framerate);
            logger.Debug("MediaInfoWrapper: VideoBitRate: {0}", _videoBitRate);
            logger.Debug("MediaInfoWrapper: VideoCodec: {0}", _videoCodec);
            if (_isDIVX)
                logger.Debug("MediaInfoWrapper: IsDIVX: {0}", _isDIVX);
            if (_isXVID)
                logger.Debug("MediaInfoWrapper: IsXVID: {0}", _isXVID);
            if (_isH264)
                logger.Debug("MediaInfoWrapper: IsH264: {0}", _isH264);
            if (_isMP1V)
                logger.Debug("MediaInfoWrapper: IsMP1V: {0}", _isMP1V);
            if (_isMP2V)
                logger.Debug("MediaInfoWrapper: IsMP2V: {0}", _isMP2V);
            if (_isMP4V)
                logger.Debug("MediaInfoWrapper: IsMP4V: {0}", _isMP4V);
            if (_isWMV)
                logger.Debug("MediaInfoWrapper: IsWMV: {0}", _isWMV);

            logger.Debug("MediaInfoWrapper: HasSubtitles: {0}", _hasSubtitles);
            logger.Debug("MediaInfoWrapper: NumSubtitles: {0}", _numSubtitles);
            logger.Debug("MediaInfoWrapper: Is3D: {0}", _is3D);
            logger.Debug("MediaInfoWrapper: MultiViewCount: {0}", _multiViewCount);
            logger.Debug("MediaInfoWrapper: ScanType: {0}", _scanType);
            logger.Debug("MediaInfoWrapper: IsInterlaced: {0}", _isInterlaced);
            logger.Debug("MediaInfoWrapper: Width: {0}", _width);
            logger.Debug("MediaInfoWrapper: Height: {0}", _height);
            logger.Debug("MediaInfoWrapper: Audiochannels: {0}", _audioChannels);
            logger.Debug("MediaInfoWrapper: AudioBitRate: {0}", _audioBitRate);
            logger.Debug("MediaInfoWrapper: AudioSampleRate: {0}", _audioSampleRate);
            logger.Debug("MediaInfoWrapper: AspectRatio: {0}", _aspectRatio);
            logger.Debug("MediaInfoWrapper: AudioCodec: {0}", _audioCodec);
            if (_isAC3)
                logger.Debug("MediaInfoWrapper: IsAC3: {0}", _isAC3);
            if (_isMP3)
                logger.Debug("MediaInfoWrapper: IsMP3: {0}", _isMP3);
            if (_isMP2A)
                logger.Debug("MediaInfoWrapper: IsMP2A: {0}", _isMP2A);
            if (_isDTS)
                logger.Debug("MediaInfoWrapper: IsDTS: {0}", _isDTS);
            if (_isTrueHD)
                logger.Debug("MediaInfoWrapper: IsTrueHD: {0}", _isTrueHD);
            if (_isDTSHD)
                logger.Debug("MediaInfoWrapper: IsDTSHD: {0}", _isDTSHD);
            if (_isOGG)
                logger.Debug("MediaInfoWrapper: IsOGG: {0}", _isOGG);
            if (_isAAC)
                logger.Debug("MediaInfoWrapper: IsAAC: {0}", _isAAC);
            if (_isWMA)
                logger.Debug("MediaInfoWrapper: IsWMA: {0}", _isWMA);
            if (_isPCM)
                logger.Debug("MediaInfoWrapper: IsPCM: {0}", _isPCM);

            logger.Debug("MediaInfoWrapper: FileSize: {0}", _fileSize);
        }
        catch (Exception ex) {
            logger.Error("MediaInfo processing failed ('MediaInfo.dll' may be missing): {0}", ex.Message);
        }
        finally {
            if (_mI != null) {
                _mI.Close();
            }
        }
    }
Ejemplo n.º 11
0
        public Dictionary <string, Dictionary <string, string> > getVideoInfo(Stream fileStream)
        {
            Dictionary <string, Dictionary <string, string> > exif = new Dictionary <string, Dictionary <string, string> >();

            try
            {
                if (fileStream.CanSeek)
                {
                    byte[] buffer     = new byte[64 * 1024];
                    int    bufferSize = 0;
                    using (MediaInfo mediaInfo = new MediaInfo())
                    {
                        mediaInfo.Open_Buffer_Init(fileStream.Length, 0);

                        do
                        {
                            //Reading data somewhere, do what you want for this.
                            bufferSize = fileStream.Read(buffer, 0, 64 * 1024);

                            //Sending the buffer to MediaInfo
                            System.Runtime.InteropServices.GCHandle GC = System.Runtime.InteropServices.GCHandle.Alloc(buffer, System.Runtime.InteropServices.GCHandleType.Pinned);
                            IntPtr From_Buffer_IntPtr = GC.AddrOfPinnedObject();
                            Status Result             = (Status)mediaInfo.Open_Buffer_Continue(From_Buffer_IntPtr, (IntPtr)bufferSize);
                            GC.Free();
                            if ((Result & Status.Finalized) == Status.Finalized)
                            {
                                break;
                            }

                            //Testing if MediaInfo request to go elsewhere
                            if (mediaInfo.Open_Buffer_Continue_GoTo_Get() != -1)
                            {
                                Int64 Position = fileStream.Seek(mediaInfo.Open_Buffer_Continue_GoTo_Get(), SeekOrigin.Begin); //Position the file
                                mediaInfo.Open_Buffer_Init(fileStream.Length, Position);                                       //Informing MediaInfo we have seek
                            }
                        }while (bufferSize > 0);

                        string t = mediaInfo.Option("Info_Parameters");
                        Dictionary <string, string> tmp = new Dictionary <string, string>();

                        if (mediaInfo.Count_Get(StreamKind.Video) != 0)
                        {
                            tmp = new Dictionary <string, string>();
                            tmp.Add("Title", mediaInfo.Get(StreamKind.Video, 0, "Title"));
                            tmp.Add("Width", mediaInfo.Get(StreamKind.Video, 0, "Width"));
                            tmp.Add("Height", mediaInfo.Get(StreamKind.Video, 0, "Height"));
                            tmp.Add("Duration", mediaInfo.Get(StreamKind.Video, 0, "Duration/String3"));
                            exif.Add("Video", tmp);
                        }

                        if (mediaInfo.Count_Get(StreamKind.Audio) != 0)
                        {
                            tmp = new Dictionary <string, string>();
                            tmp.Add("Title", mediaInfo.Get(StreamKind.Audio, 0, "Title"));
                            tmp.Add("Duration", mediaInfo.Get(StreamKind.Audio, 0, "Duration/String3"));
                            exif.Add("Audio", tmp);
                        }
                        return(exif);
                    }
                }
                else
                {
                    return(exif);
                }
            }
            catch
            {
                return(exif);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>


        //[STAThread]
        //static void Main()
        //{
        //    Application.Run(new Form1());
        //}

        private void Form1_Load(object sender, System.EventArgs e)
        {
            //Test if version of DLL is compatible : 3rd argument is "version of DLL tested;Your application name;Your application version"
            String    ToDisplay;
            MediaInfo MI = new MediaInfo();

            ToDisplay = MI.Option("Info_Version", "0.7.0.0;MediaInfoDLL_Example_CS;0.7.0.0");
            if (ToDisplay.Length == 0)
            {
                richTextBox1.Text = "MediaInfo.Dll: this version of the DLL is not compatible";
                return;
            }

            //Information about MediaInfo
            ToDisplay += "\r\n\r\nInfo_Parameters\r\n";
            ToDisplay += MI.Option("Info_Parameters");

            ToDisplay += "\r\n\r\nInfo_Capacities\r\n";
            ToDisplay += MI.Option("Info_Capacities");

            ToDisplay += "\r\n\r\nInfo_Codecs\r\n";
            ToDisplay += MI.Option("Info_Codecs");

            //An example of how to use the library
            ToDisplay += "\r\n\r\nOpen\r\n";
            MI.Open(@"F:\Reng\baiduYun_Download\God.Of.Gamblers.1989.720p.HDTV.2Audio.DD2.0.x264-th71@beAst\[email protected]");

            ToDisplay += "\r\n\r\nInform with Complete=false\r\n";
            MI.Option("Complete");

            String p = MI.Inform();

            Console.WriteLine(p);
            ToDisplay += p;
            formatString(p);

            ToDisplay += "\r\n\r\nInform with Complete=true\r\n";
            MI.Option("Complete", "1");
            ToDisplay += MI.Inform();

            ToDisplay += "\r\n\r\nCustom Inform\r\n";
            MI.Option("Inform", "General;File size is %FileSize% bytes");
            ToDisplay += MI.Inform();

            ToDisplay += "\r\n\r\nGet with Stream=General and Parameter='FileSize'\r\n";
            ToDisplay += MI.Get(0, 0, "FileSize");
            Console.WriteLine(MI.Get(0, 0, "FileSize"));

            ToDisplay += "\r\n\r\nGet with Stream=General and Parameter=46\r\n";
            ToDisplay += MI.Get(0, 0, 46);

            ToDisplay += "\r\n\r\nCount_Get with StreamKind=Stream_Audio\r\n";
            ToDisplay += MI.Count_Get(StreamKind.Audio);
            Console.WriteLine(MI.Count_Get(StreamKind.Audio));

            ToDisplay += "\r\n\r\nGet with Stream=General and Parameter='AudioCount'\r\n";
            ToDisplay += MI.Get(StreamKind.General, 0, "AudioCount");

            ToDisplay += "\r\n\r\nGet with Stream=Audio and Parameter='StreamCount'\r\n";
            ToDisplay += MI.Get(StreamKind.Audio, 0, "StreamCount");

            ToDisplay += "\r\n\r\nClose\r\n";
            MI.Close();


            //Example with a stream
            //ToDisplay+="\r\n"+ExampleWithStream()+"\r\n";

            //Displaying the text
            richTextBox1.Text = ToDisplay;
        }
Ejemplo n.º 13
0
 private static void ProcessSubtitles(MediaInfoData result, MediaInfo mi, string filePath)
 {
     // check embedded subtitles
     // process each sub and add it to the list
     if (mi != null && !IsISO(filePath))
     {
         try
         {
             int _subsCnt = mi.Count_Get(StreamKind.Text);
             if (_subsCnt != 0)
             {
                 for (int _i = 0; _i < _subsCnt; _i++)
                 {
                     EmbeddedSubtitle _sub = new EmbeddedSubtitle();
                     _sub.Format   = mi.Get(StreamKind.Text, _i, "Format");
                     _sub.Language = mi.Get(StreamKind.Text, _i, "Language");
                     if (string.IsNullOrEmpty(_sub.Language))
                     {
                         _sub.Language = mi.Get(StreamKind.Text, _i, "Title");
                     }
                     _sub.Language = string.IsNullOrEmpty(_sub.Language) ? FileManager.Configuration.Options.MovieSheetsOptions.DefaultExternalSubtitlesLanguage : _sub.Language;
                     if (PopulateLanguages(_sub))
                     {
                         if (!string.IsNullOrEmpty(_sub.Language) && !string.IsNullOrEmpty(_sub.Format))
                         {
                             result.EmbeddedSubtitles.Add(_sub);
                         }
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             Loggy.Logger.DebugException("Embedded subs: ", ex);
         }
     }
     // process also the external subtitles
     try
     {
         ExternalSubtitlesInfo _subtitles = CollectExternalSubtitles(filePath, false);
         if (_subtitles.HasExternalSubtitles)
         {
             foreach (ExtSubData _subData in _subtitles.SubFiles)
             {
                 EmbeddedSubtitle _sub = new EmbeddedSubtitle();
                 _sub.Format   = _subData.Format;
                 _sub.Language = _subData.TwoLetterLanguageCode;
                 if (PopulateLanguages(_sub))
                 {
                     if (!string.IsNullOrEmpty(_sub.Language) && !string.IsNullOrEmpty(_sub.Format))
                     {
                         result.ExternalSubtitlesList.Add(_sub);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Loggy.Logger.DebugException("External subs: ", ex);
     }
 }
Ejemplo n.º 14
0
        public static MediaInfoData GetMediaInfoData(string filePath, bool getTextData, bool getXml, bool getDetails, out string textData)
        {
            MediaInfoData _result = new MediaInfoData();

            textData = string.Empty;

            if (FileManager.Configuration.Options.DisableMediaInfoProcessing)
            {
                return(_result);
            }

            try
            {
                string _originalFilePath = filePath;

                if (IsISO(filePath))
                {
                    filePath = RedirectISO(filePath);
                    if (string.IsNullOrEmpty(filePath))
                    {
                        ProcessSubtitles(_result, null, _originalFilePath);
                        return(_result); // get out if u couldn't extract the .ifo
                    }
                }

                MediaInfo _mi = new MediaInfo();
                _mi.Open(filePath);

                if (getTextData)
                {
                    if (getXml)
                    {
                        _mi.Option("Inform", "XML");
                        textData = _mi.Inform();
                        // sometimes mediainfo returns invalid chars in node name. try to fix that (for now the &)
                        // Temporary Fix until it gets fixed in mediainfo
                        textData = Regex.Replace(textData, "(</?\\w+)(&)(\\w+)", "$1_$3", RegexOptions.IgnoreCase);
                        textData = Regex.Replace(textData, "(</?\\w+)(#)(\\w+)", "$1_$3", RegexOptions.IgnoreCase);
                    }
                    else
                    {
                        _mi.Option("Inform", "TEXT");
                        textData = _mi.Inform();
                    }
                }

                if (!getDetails)
                {
                    _mi.Close();
                    return(_result);
                }

                // format
                SetFormat(_result, _mi, filePath);

                // filesize (be aware of a possible redirection .iso->.ifo for example... use in that case the _originalFilePath
                string _filesize = string.Compare(_originalFilePath, filePath, true) == 0 ? _mi.Get(StreamKind.General, 0, "FileSize") : new FileInfo(_originalFilePath).Length.ToString();
                //double _fs = 0;
                //if (double.TryParse(_filesize, out _fs))
                //{
                //    _filesize = Helpers.GetFormattedFileSize(_fs);
                //}
                _result.FileSizeBytes = _filesize;

                // resolution
                // check resolution
                string _height      = _mi.Get(StreamKind.Video, 0, "Height");
                string _width       = _mi.Get(StreamKind.Video, 0, "Width");
                string _aspectRatio = _mi.Get(StreamKind.Video, 0, "DisplayAspectRatio");

                _result.VideoResolution = string.Format("{0}x{1}", _width, _height);

                // check aspect ratio
                if (!string.IsNullOrEmpty(_aspectRatio))
                {
                    double _aspect = 0d;
                    try
                    {
                        _aspect = Double.Parse(_aspectRatio.Replace(",", "."), CultureInfo.InvariantCulture);
                    }
                    catch { }

                    _aspectRatio = string.Format("{0:0.00}:1", _aspect).Replace(",", ".");
                    if (_aspect > 1.3 && _aspect < 1.4)
                    {
                        _aspectRatio = "4:3";
                    }
                    if (_aspect == 1.500)
                    {
                        _aspectRatio = "3:2";
                    }
                    if (_aspect > 1.7 && _aspect < 1.8)
                    {
                        _aspectRatio = "16:9";
                    }

                    if (_aspect > 2.3 && _aspect < 2.4)
                    {
                        _aspectRatio = "2.35:1";
                    }
                }
                _result.AspectRatio = _aspectRatio;

                // check refresh rate
                _result.FrameRate = _mi.Get(StreamKind.Video, 0, "FrameRate");

                int    _h  = 5000;
                int    _w  = 5000;
                double _ar = 0;
                Int32.TryParse(_height, out _h);
                Int32.TryParse(_width, out _w);
                double.TryParse(_aspectRatio, out _ar);

                if (_w != 0 && _h != 0)
                {
                    _result.Resolution.Flag = MediaInfoFlags.Resolution_288p;
                }
                if (_w > 320 && _h > 240)
                {
                    _result.Resolution.Flag = MediaInfoFlags.Resolution_480p;
                }

                if (_h >= 576)
                {
                    _result.Resolution.Flag = MediaInfoFlags.Resolution_576p;
                }

                if ((_ar == _16_9 && _w >= 1280 && _h >= 720) || (_ar != _16_9 && _w > 720 && _h > 544) || _w >= 1280)
                {
                    _result.Resolution.Flag = MediaInfoFlags.Resolution_720p;
                }

                if ((_ar == _16_9 && _w >= 1920 && _h >= 1080) || (_ar != _16_9 && _w > 1280 || _h > 817))
                {
                    _result.Resolution.Flag = MediaInfoFlags.Resolution_1080p;
                }

                // check overallbitrate
                _result.OverallBitrate = Helpers.GetFormattedBitrate(_mi.Get(StreamKind.General, 0, "OverallBitRate"));
                if (string.IsNullOrEmpty(_result.OverallBitrate))
                {
                    _result.OverallBitrate = Helpers.GetFormattedBitrate(_mi.Get(StreamKind.General, 0, "OverallBitRate_Nominal"));
                }

                // check videobitrate
                _result.VideoBitrate = Helpers.GetFormattedBitrate(_mi.Get(StreamKind.Video, 0, "BitRate"));
                if (string.IsNullOrEmpty(_result.VideoBitrate))
                {
                    _result.VideoBitrate = Helpers.GetFormattedBitrate(_mi.Get(StreamKind.Video, 0, "BitRate_Nominal"));
                }

                //check video codec
                string _fr = _mi.Get(StreamKind.Video, 0, "Format");
                if (!string.IsNullOrEmpty(_fr) && _fr.ToLowerInvariant().Contains("mpeg"))
                {
                    _result.Video.Flag = MediaInfoFlags.Video_mpeg;
                }

                string _videoCodec = _mi.Get(StreamKind.Video, 0, "CodecID/Hint");
                if (string.IsNullOrEmpty(_videoCodec))
                {
                    _videoCodec = _mi.Get(StreamKind.Video, 0, "CodecID");
                }

                // check videocodec
                _result.VideoCodec = GetCodecInfoText(_mi, StreamKind.Video);

                if (string.IsNullOrEmpty(_videoCodec))
                {
                    _videoCodec = _result.VideoCodec;
                }

                if (!string.IsNullOrEmpty(_videoCodec))
                {
                    _videoCodec = _videoCodec.ToLowerInvariant();
                }
                if (_videoCodec.Contains("xvid"))
                {
                    _result.Video.Flag = MediaInfoFlags.Video_Xvid;
                }
                if (_videoCodec.Contains("divx") || _videoCodec.Contains("dx"))
                {
                    _result.Video.Flag = MediaInfoFlags.Video_Divx;
                }
                if (_videoCodec.Contains("wmv"))
                {
                    _result.Video.Flag = MediaInfoFlags.Video_WMVHD;
                }
                if (_videoCodec.Contains("avc"))
                {
                    _result.Video.Flag = MediaInfoFlags.Video_H264;
                }
                if (!string.IsNullOrEmpty(_fr) && _fr.ToLowerInvariant().Contains("avc"))
                {
                    _result.Video.Flag = MediaInfoFlags.Video_H264;
                }


                // check language
                int _cnt = _mi.Count_Get(StreamKind.Audio);

                for (int _ia = 0; _ia < _cnt; _ia++)
                {
                    string _languageCode = _mi.Get(StreamKind.Audio, _ia, "Language");
                    if (string.IsNullOrEmpty(_languageCode))
                    {
                        _languageCode = FileManager.Configuration.Options.MovieSheetsOptions.DefaultAudioLanguage;
                    }
                    _result.LanguageCode = _ia == 0 || string.IsNullOrEmpty(_result.LanguageCode) ? _languageCode : _result.LanguageCode;
                    _result.LanguageCodes.Add(_languageCode);

                    if (!string.IsNullOrEmpty(_languageCode))
                    {
                        CultureInfo _ci = null;
                        try
                        {
                            _ci = Helpers.GetCultureInfo(_languageCode);
                        }
                        catch (Exception ex)
                        {
                            Loggy.Logger.DebugException("Lang2", ex);
                        }
                        if (_ci != null && _ci != CultureInfo.InvariantCulture)
                        {
                            _result.Language = _ia == 0 || string.IsNullOrEmpty(_result.Language) ? _ci.EnglishName : _result.Language;
                            _result.Languages.Add(_ci.EnglishName);
                        }
                    }
                }

                // check audio
                string _audioFormat   = _mi.Get(StreamKind.Audio, 0, "Format").ToLowerInvariant();
                string _audioCodec    = _mi.Get(StreamKind.Audio, 0, "CodecID").ToLowerInvariant();
                string _audioHint     = _mi.Get(StreamKind.Audio, 0, "CodecID/Hint").ToLowerInvariant();
                string _audioChannels = _mi.Get(StreamKind.Audio, 0, "Channel(s)").ToLowerInvariant();
                string _audioProfile  = _mi.Get(StreamKind.Audio, 0, "Format_Profile").ToLowerInvariant();

                _result.AudioBitrate = Helpers.GetFormattedBitrate(_mi.Get(StreamKind.Audio, 0, "BitRate"));
                if (string.IsNullOrEmpty(_result.AudioBitrate))
                {
                    _result.AudioBitrate = Helpers.GetFormattedBitrate(_mi.Get(StreamKind.Audio, 0, "BitRate_Nominal"));
                    if (string.IsNullOrEmpty(_result.AudioBitrate))
                    {
                        _result.AudioBitrate = _mi.Get(StreamKind.Audio, 0, "BitRate_Mode");
                    }
                }

                _result.AudioCodec    = GetCodecInfoText(_mi, StreamKind.Audio);
                _result.AudioChannels = _audioChannels;

                if (_audioFormat.Contains("dts") || _audioCodec.Contains("dts") || _audioHint.Contains("dts"))
                {
                    _result.Audio.Flag = MediaInfoFlags.Audio_DTS;
                }
                if (_audioFormat.Contains("dts") && (_audioProfile.Contains("ma")))
                {
                    _result.Audio.Flag = MediaInfoFlags.Audio_DTSHD;
                }

                if (_audioFormat.Contains("mp3") || _audioCodec.Contains("55") || _audioHint.Contains("mp3"))
                {
                    _result.Audio.Flag = MediaInfoFlags.Audio_MP3;
                }
                if (_audioFormat.Contains("ac-3") || _audioCodec.Contains("ac3") || _audioHint.Contains("ac3"))
                {
                    if (_audioChannels.Contains("6"))
                    {
                        _result.Audio.Flag = MediaInfoFlags.Audio_DolbyDigital;
                    }
                    else
                    {
                        _result.Audio.Flag = MediaInfoFlags.Audio_DolbyStereo;
                    }
                }
                if (_audioFormat.Contains("truehd") || (_audioCodec.Contains("truehd")))
                {
                    _result.Audio.Flag = MediaInfoFlags.Audio_DolbyTrueHD;
                }

                if (_audioFormat.Contains("aac") || _audioCodec.Contains("aac") || _audioHint.Contains("aac"))
                {
                    if (_audioChannels.Contains("6"))
                    {
                        _result.Audio.Flag = MediaInfoFlags.Audio_AAC51;
                    }
                    else
                    {
                        //if (_audioProfile.Contains("lc"))
                        //{
                        //    _result.Audio.Flag = MediaInfoFlags.Audio_AACStereoLC;
                        //}
                        //else
                        //{
                        _result.Audio.Flag = MediaInfoFlags.Audio_AACStereo;
                        //}
                    }
                }
                if (_audioFormat.Contains("flac") || _audioCodec.Contains("flac"))
                {
                    _result.Audio.Flag = MediaInfoFlags.Audio_Flac;
                }
                if (_audioFormat.Contains("wma") || _audioCodec.Contains("162"))
                {
                    _result.Audio.Flag = MediaInfoFlags.Audio_WMA;
                }
                if (_audioFormat.Contains("vorbis") || _audioCodec.Contains("vorbis"))
                {
                    _result.Audio.Flag = MediaInfoFlags.Audio_Vorbis;
                }

                ProcessSubtitles(_result, _mi, filePath);

                // set this flag for the ThumbGen's GUI.. to signal presence of any kind of subtitles
                string _subsLanguage = _mi.Get(StreamKind.Text, 0, "Language").ToLowerInvariant();
                if (!string.IsNullOrEmpty(_subsLanguage))
                {
                    _result.Subtitles.Flag = !string.IsNullOrEmpty(_result.SubtitlesText) || _result.ExternalSubtitlesList.Count != 0 ? MediaInfoFlags.Subtitles_Generic : MediaInfoFlags.Unknown;
                }

                _mi.Close();
            }
            catch { }

            return(_result);
        }