当前位置: 首页>>代码示例>>C#>>正文


C# MediaInfo.Inform方法代码示例

本文整理汇总了C#中MediaInfoLib.MediaInfo.Inform方法的典型用法代码示例。如果您正苦于以下问题:C# MediaInfo.Inform方法的具体用法?C# MediaInfo.Inform怎么用?C# MediaInfo.Inform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaInfoLib.MediaInfo的用法示例。


在下文中一共展示了MediaInfo.Inform方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MediaViewModel

        public MediaViewModel(string Name = "",
            string ArtistName = "",
            string AlbumName = "",
            Uri Path = null,
            String Length = "00:00:00")
        {
            Dictionary<String, String> tmp = new Dictionary<string, string>();
            if (Path != null)
            {
                try
                {
                    MediaInfo lol = new MediaInfo();
                    if (lol.Open(Uri.UnescapeDataString(Path.AbsolutePath)) == 1)
                    {
                        foreach (string entry in lol.Inform().Split('\n'))
                        {
                            var tokens = entry.Split(':');
                            if (tokens.Length == 2)
                                tmp[tokens[0].Trim()] = tokens[1].Trim();
                        }
                        lol.Close();
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show("MediaInfo: "+ e.Message);
                }
            }

            Song = new Media(tmp.ContainsKey("Track name") ? tmp["Track name"] : "",
                            tmp.ContainsKey("Performer") ? tmp["Performer"] : "",
                            tmp.ContainsKey("Album") ? tmp["Album"] : "",
                            Path, tmp.ContainsKey("Duration") ? getLength(tmp["Duration"]) : "");
        }
开发者ID:Vyko,项目名称:MyWmp,代码行数:34,代码来源:MediaViewModel.cs

示例2: Main

        public static void Main(string[] args)
        {
            String ToDisplay = "";
            MediaInfo MI = new MediaInfo();
            //An example of how to use the library
            ToDisplay += "\r\n\r\nOpen\r\n";
            MI.Open(args[0]);

            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();

            Console.WriteLine(ToDisplay);
        }
开发者ID:lovebomb,项目名称:linkwithweb,代码行数:40,代码来源:MediaInfoRead.cs

示例3: Form1_Load

		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();

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

            //Displaying the text
			richTextBox1.Text = ToDisplay;
		}
开发者ID:bedashii,项目名称:ReturnMedz,代码行数:63,代码来源:HowToUse_Dll.cs

示例4: getNewNameForMp4

 private string getNewNameForMp4(string path)
 {
     try
     {
         FileInfo fi = new FileInfo(path);
         MediaInfo mi = new MediaInfo();
         mi.Open(path);
         string[] dataLines = mi.Inform().Split('\n');
         foreach (string line in dataLines)
         {
             if (line.StartsWith("Encoded date"))
             {
                 // parse `encoded date` tag:
                 // >Encoded date                             : UTC 2014-07-29 15:21:29
                 string newLine = line.Substring(line.IndexOf(':') + 1);    // > UTC 2014-07-29 15:21:29
                 newLine = newLine.Replace("UTC", "");                       // >  2014-07-29 15:21:29
                 newLine = newLine.Trim();                                   // >2014-07-29 15:21:29
                 //newLine = newLine.Replace(':', '-');                      // >2014-07-29 15-21-29
                 DateTime dt = DateTime.Parse(newLine);
                 PersianCalendar pc = new PersianCalendar();
                 StringBuilder result = new StringBuilder();
                 result.Append(pc.GetYear(dt));
                 result.Append('_');
                 result.Append(pc.GetMonth(dt));
                 return String.Format(
                     "{0}_{1,2:D2}_{2,2:D2} - {3:D2}_{4:D2}_{5:D2}{6}",
                     pc.GetYear(dt),
                     pc.GetMonth(dt),
                     pc.GetDayOfMonth(dt),
                     pc.GetHour(dt),
                     pc.GetMinute(dt),
                     pc.GetSecond(dt),
                     fi.Extension
                 );
             }
         }
         return "";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return "";
     }
 }
开发者ID:alimzadeh,项目名称:FixCameraFileName,代码行数:44,代码来源:FrmMain.cs

示例5: Main

        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);

            Console.Out.WriteLine("Press a key to close window.");
            Console.Read();
        }
开发者ID:Nicholi,项目名称:MediaInfoDotNet,代码行数:67,代码来源:HowToUse_Dll_CLI.cs

示例6: IndexCrop

        private bool IndexCrop()
        {
            try
            {
                DoPlugin(PluginType.BeforeAutoCrop);

                string filename = "";
                AdvancedVideoOptions avo = null;
                foreach (StreamInfo si in demuxedStreamList.streams)
                {
                    if (si.streamType == StreamType.Video)
                    {
                        filename = si.filename;
                        if (si.advancedOptions != null && si.advancedOptions.GetType() == typeof(AdvancedVideoOptions)) avo = (AdvancedVideoOptions)si.advancedOptions;
                        break;
                    }
                }

                string fps = "";
                string resX = "";
                string resY = "";
                string length = "";
                string frames = "";

                try
                {
                    MediaInfoLib.MediaInfo mi2 = new MediaInfoLib.MediaInfo();
                    mi2.Open(filename);
                    mi2.Option("Complete", "1");
                    string[] tmpstr = mi2.Inform().Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string s in tmpstr)
                    {
                        logWindow.MessageCrop(s.Trim());
                    }
                    if (mi2.Count_Get(StreamKind.Video) > 0)
                    {
                        fps = mi2.Get(StreamKind.Video, 0, "FrameRate");
                        resX = mi2.Get(StreamKind.Video, 0, "Width");
                        resY = mi2.Get(StreamKind.Video, 0, "Height");
                        length = mi2.Get(StreamKind.Video, 0, "Duration");
                        frames = mi2.Get(StreamKind.Video, 0, "FrameCount");
                    }
                    mi2.Close();
                }
                catch (Exception ex)
                {
                    logWindow.MessageCrop(Global.Res("ErrorMediaInfo") + " " + ex.Message);
                    return false;
                }

                if (avo != null && avo.disableFps)
                {
                    logWindow.MessageCrop(Global.Res("InfoManualFps"));
                    fps = avo.fps;
                    length = avo.length;
                    frames = avo.frames;
                }

                if (fps == "")
                {
                    logWindow.MessageCrop(Global.Res("ErrorFramerate"));
                    foreach (StreamInfo si in demuxedStreamList.streams)
                    {
                        if (si.streamType == StreamType.Video)
                        {
                            if (si.desc.Contains("24 /1.001"))
                            {
                                logWindow.MessageCrop(Global.ResFormat("InfoFps", " 23.976"));
                                fps = "23.976";
                                break;
                            }
                            else if (si.desc.Contains("1080p24 (16:9)"))
                            {
                                logWindow.MessageCrop(Global.ResFormat("InfoFps", " 24"));
                                fps = "24";
                                break;
                            }
                            // add other framerates here
                        }
                    }
                    if (fps == "")
                    {
                        logWindow.MessageCrop(Global.Res("ErrorNoFramerate"));
                        return false;
                    }
                }

                if (frames == "" || length == "")
                {
                    logWindow.MessageCrop(Global.Res("InfoFrames"));
                }

                CropInfo cropInfo = new CropInfo();
                if (!settings.untouchedVideo)
                {
                    if (settings.cropInput == 1 || settings.encodeInput == 1)
                    {
                        bool skip = false;
                        if (File.Exists(filename + ".ffindex") && !settings.deleteIndex)
                        {
//.........这里部分代码省略.........
开发者ID:CommanderBubble,项目名称:Blurip,代码行数:101,代码来源:IndexCrop.cs

示例7: ReadFile

        /// <summary>
        /// Reads a media file and creates a MediaFile object
        /// </summary>
        /// <param name="fp">File Path of the Media File</param>
        /// <returns>MediaFile object</returns>
        public void ReadFile()
        {
            this.Source = Source;

            if (File.Exists(FilePath))
            {
                //*********************
                //* General
                //*********************

                //System.Debug.WriteLine("Current Dir1: " + System.Environment.CurrentDirectory);
                //System.Environment.CurrentDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                //System.Debug.WriteLine("Current Dir2: " + System.Environment.CurrentDirectory);

                MediaInfoLib.MediaInfo MI = null;
                try
                {
                    Debug.WriteLine("Loading MediaInfo.dll");
                    MI = new MediaInfoLib.MediaInfo();
                    Debug.WriteLine("Loaded MediaInfo.dll");
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.ToString());
                }

                if (MI != null)
                {
                    Debug.WriteLine(string.Format("MediaInfo Opening {0}", FilePath));
                    MI.Open(FilePath);
                    Debug.WriteLine(string.Format("MediaInfo Opened {0}", FilePath));
                    MI.Option("Complete");
                    this.Summary = MI.Inform();
                    MI.Option("Complete", "1");
                    this.SummaryComplete = MI.Inform();

                    if (Program.IsUNIX)
                    {
                        Debug.WriteLine(string.Format("MediaInfo Summary Length: {0}", this.Summary.Length.ToString()));
                        Debug.WriteLine(string.Format("MediaInfo Summary: {0}", this.Summary));
                    }

                    // Format Info
                    if (string.IsNullOrEmpty(this.Format))
                        this.Format = MI.Get(StreamKind.General, 0, "Format");
                    this.FormatInfo = MI.Get(StreamKind.General, 0, "Format/Info");

                    // this.FileName = mMI.Get(0, 0, "FileName");
                    if (0 == this.FileSize)
                    {
                        double sz;
                        double.TryParse(MI.Get(0, 0, "FileSize"), out sz);
                        this.FileSize = sz;
                    }
                    if (string.IsNullOrEmpty(this.FileSizeString))
                    {
                        this.FileSizeString = string.Format("{0} MiB", (this.FileSize / 1024.0 / 1024.0).ToString("0.00"));
                    }

                    // Duration
                    if (string.IsNullOrEmpty(this.DurationString2))
                        this.DurationString2 = MI.Get(0, 0, "Duration/String2");

                    if (this.Duration == 0.0)
                    {
                        double dura = 0.0;
                        double.TryParse(MI.Get(0, 0, "Duration"), out dura);
                        this.Duration = dura;
                        this.SegmentDuration = dura;
                    }

                    if (string.IsNullOrEmpty(this.DurationString3))
                        this.DurationString3 = MI.Get(0, 0, "Duration/String3");

                    this.BitrateOverall = MI.Get(StreamKind.General, 0, "OverallBitRate/String");
                    this.EncodedApplication = MI.Get(StreamKind.General, 0, "Encoded_Application");
                    this.EncodedDate = MI.Get(StreamKind.General, 0, "Encoded_Date");

                    if (string.IsNullOrEmpty(this.Subtitles))
                    {
                        StringBuilder sbSubs = new StringBuilder();

                        int subCount = 0;
                        int.TryParse(MI.Get(StreamKind.Text, 0, "StreamCount"), out subCount);

                        if (subCount > 0)
                        {
                            StringBuilder sbLang = new StringBuilder();
                            for (int i = 0; i < subCount; i++)
                            {
                                string lang = MI.Get(StreamKind.Text, i, "Language/String");
                                if (!string.IsNullOrEmpty(lang))
                                {
                                    // System.Windows.Forms.MessageBox.Show(lang);
                                    sbLang.Append(lang);
//.........这里部分代码省略.........
开发者ID:a253560600,项目名称:tdmaker,代码行数:101,代码来源:MediaFile.cs

示例8: StreamInfo

 public StreamInfo(string fullpath)
 {
     try
     {
         MediaInfo MI = new MediaInfo();
         version = MI.Option("Info_Version", "0.7.0.0;MediaInfoDLL_Example_CS;0.7.0.0");
         if (version.Length == 0)
         {
             //Logging.Writer(System.Diagnostics.TraceEventType.Warning, "MediaInfoDLL Errer");
             return;
         }
         if (MI.Open(fullpath) == 0)
         {
             //Logging.Writer(System.Diagnostics.TraceEventType.Warning, "MediaInfoDLL File Open Errer File=" + fullpath);
             return;
         }
         MI.Option("Complete", "1");
         string result = MI.Inform();
         MI.Option("Inform", "General;%Duration/String3%");
         result = MI.Inform();
         if (result.Length <= 0)
         {
             //Logging.Writer(System.Diagnostics.TraceEventType.Warning, "MediaInfoDLL Get Duration");
             return;
         }
         int Hour = int.Parse(result.Substring(0, 2));
         int Minute = int.Parse(result.Substring(3, 2));
         int Second = int.Parse(result.Substring(6, 2));
         this.duration = new TimeSpan(Hour, Minute, Second);
         this.bitrate = long.Parse(MI.Get(StreamKind.General, 0, "OverallBitRate"));
         int count = MI.Count_Get(StreamKind.Video);
         for (int i = 0; i < count; i++)
         {
             Video video = new Video(MI, i);
             this.Videos.Add(video);
         }
         count = MI.Count_Get(StreamKind.Audio);
         for (int i = 0; i < count; i++)
         {
             Audio audio = new Audio(MI,i);
             this.Audios.Add(audio);
         }
     }
     catch (Exception ex) { /*Logging.Writer(ex);*/ }
 }
开发者ID:nakamura24,项目名称:MediaInfoInterface,代码行数:45,代码来源:StreamInfo.cs

示例9: ChaptersExist

        private bool ChaptersExist(String file)
        {
            WriteLog("Checking if file contains chapters: " + file);
            var info = new MediaInfo();
            info.Open(file);

            info.Option("Inform", "XML");
            info.Option("Complete");
            if (info.Inform().Contains("<track type=\"Menu\""))
            {
                WriteLog("It contains chapters");
                return true;
            }

            WriteLog("It didn't contain chapters");
            return false;
        }
开发者ID:Jim-1960,项目名称:mkv-chapterizer,代码行数:17,代码来源:TheChapterizer.cs

示例10: CheckInputFile

        private void CheckInputFile(Media mf)
        {
            using (FFMpegWrapper ff = new FFMpegWrapper(mf.FullPath))
            {
                inputFileStreams = ff.GetStreamInfo();
            }

            MediaInfo mi = new MediaInfo();
            try
            {
                mi.Open(mf.FullPath);
                mi.Option("Complete");
                string miOutput = mi.Inform();

                Regex format_lxf = new Regex("Format\\s*:\\s*LXF");
                if (format_lxf.Match(miOutput).Success)
                {
                    string[] miOutputLines = miOutput.Split('\n');
                    Regex vitc = new Regex("ATC_VITC");
                    Regex re = new Regex("Time code of first frame\\s*:[\\s]\\d{2}:\\d{2}:\\d{2}:\\d{2}");
                    for (int i = 0; i < miOutputLines.Length; i++)
                    {
                        if (vitc.Match(miOutputLines[i]).Success && i >= 1)
                        {
                            Match m_tcs = re.Match(miOutputLines[i - 1]);
                            if (m_tcs.Success)
                            {
                                Regex reg_tc = new Regex("\\d{2}:\\d{2}:\\d{2}:\\d{2}");
                                Match m_tc = reg_tc.Match(m_tcs.Value);
                                if (m_tc.Success)
                                {
                                    DestMedia.TCStart = reg_tc.Match(m_tc.Value).Value.SMPTETimecodeToTimeSpan();
                                    if (DestMedia.TCPlay == TimeSpan.Zero)
                                        DestMedia.TCPlay = DestMedia.TCStart;
                                    break;
                                }
                            }
                        }
                    }
                }

                Regex format_mxf = new Regex(@"Format\s*:\s*MXF");
                if (format_mxf.Match(miOutput).Success)
                {
                    string[] miOutputLines = miOutput.Split('\n');
                    Regex mxf_tc = new Regex(@"MXF TC");
                    Regex re = new Regex(@"Time code of first frame\s*:[\s]\d{2}:\d{2}:\d{2}:\d{2}");
                    for (int i = 0; i < miOutputLines.Length; i++)
                    {
                        Match mxf_match = mxf_tc.Match(miOutputLines[i]);
                        if (mxf_match.Success && i < miOutputLines.Length - 1)
                        {
                            Regex reg_tc = new Regex(@"\d{2}:\d{2}:\d{2}:\d{2}");
                            Match m_tc = re.Match(miOutputLines[i + 1]);
                            if (m_tc.Success)
                            {
                                DestMedia.TCStart = reg_tc.Match(m_tc.Value).Value.SMPTETimecodeToTimeSpan();
                                if (DestMedia.TCPlay == TimeSpan.Zero)
                                    DestMedia.TCPlay = DestMedia.TCStart;
                                break;
                            }
                        }
                    }
                }
            }
            finally
            {
                mi.Close();
            }
        }
开发者ID:jstarpl,项目名称:PlayoutAutomation,代码行数:70,代码来源:ConvertOperation.cs

示例11: FileMediaInformation

        public static void FileMediaInformation()
        {
            Console.WriteLine("Introduzca una ruta:");
            FilePath = Console.ReadLine();

            if (File.Exists(FilePath))
            {
                MediaInfo _info = new MediaInfo();

                Console.WriteLine(_info.Option("Info_Version", "0.7.0.0;MediaInfoDLL_Example_CS;0.7.0.0"));

                _info.Open(FilePath);

                //informacion del archivo, tipo de archivo, filesize, etc...
                _info.Option("Complete");
                Console.WriteLine(_info.Inform());

                Console.WriteLine("\n----------------------------------");

                //file size
                _info.Option("Inform", "General;File size is %FileSize% bytes");
                Console.WriteLine(_info.Inform());

                Console.WriteLine("\n----------------------------------");

                Console.WriteLine(_info.Count_Get(StreamKind.Audio));

                Console.WriteLine("\n----------------------------------");

                Console.WriteLine(_info.Get(StreamKind.General, 0, "AudioCount"));

                Console.WriteLine("\n----------------------------------");

                Console.WriteLine(_info.Get(StreamKind.Audio, 0, "StreamCount"));

                Console.WriteLine("\n----------------------------------");

                //tipo de formato del archivo
                Console.WriteLine(_info.Get(StreamKind.General, 0, "Format"));

                Console.WriteLine("\n----------------------------------");

                Console.WriteLine(_info.Get(StreamKind.Audio, 0, "BitRate"));

                Console.WriteLine("\n----------------------------------");

                Console.WriteLine(ExampleWithStream());

                do
                {
                    Console.WriteLine("\n----------------------------------");
                    Console.WriteLine("Introduzca un comando para StreamKind.Audio:");
                    Console.WriteLine(_info.Get(StreamKind.Audio, 0, Console.ReadLine()));
                    Console.WriteLine("\n----------------------------------");
                    Console.WriteLine("\nDesea Continuar? Y/N");
                }
                while (Console.ReadLine().ToUpper() != "N");

                Console.ReadLine();
            }
            else {
                Console.WriteLine("El archivo no existe. Desea Continuar? Y/N");
                if (Console.ReadLine().ToUpper() != "N")
                {
                    FileMediaInformation();
                }
            }
        }
开发者ID:JoseRochaVidrio,项目名称:MediaInfoTest,代码行数:68,代码来源:Program.cs

示例12: Form1_Load

        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();

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

            Crc16Ccitt A=new Crc16Ccitt(InitialCrcValue.Zeros);
            byte[] B = { 0x84, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x67, 0x1F, 0x20, 0x00, 0x00, 0x62, 0x0C, 0x9B, 0x35, 0x35, 0x38, 0x3B, 0x34, 0x31, 0x36, 0x20, 0x56, 0x9B, 0x38, 0x31, 0x3B, 0x33, 0x32, 0x20, 0x5F, 0x90, 0x6F, 0x90, 0x20, 0x41, 0x90, 0x7E, 0x9B, 0x31, 0x3B, 0x30, 0x30, 0x30, 0x30, 0x20, 0x63, 0x9B, 0x30, 0x20, 0x58, 0x1C, 0x40, 0x40, 0x1C, 0x46, 0x40, 0x90, 0x20, 0x40, 0x90, 0x50, 0xC9, 0xB3, 0xC7, 0x89, 0x20, 0x1D, 0x61, 0x1B, 0x7E, 0xC0, 0xA4, 0xE9, 0xF3, 0xC1, 0xF3, 0x8A, 0x24, 0x72, 0x21, 0x29, 0x88, 0x1C, 0x4F, 0x41, 0x89, 0xE1, 0xAD, 0xB7, 0xB3, 0x8A, 0x21, 0x29, 0x89, 0x20, 0x8A, 0x21, 0x44, 0x89, 0xA4, 0xF3, 0xBF, 0xF9, 0xCD, 0xC3, 0xC8, 0x8A, 0x21, 0x29 };
            ushort C=A.ComputeChecksum(B);

            //Displaying the text
            richTextBox1.Text = ToDisplay;
        }
开发者ID:beppec56,项目名称:MediaInfoLib-git_svn,代码行数:67,代码来源:HowToUse_Dll.cs

示例13: ChaptersExist

        private bool ChaptersExist(String file)
        {
            MediaInfo info = new MediaInfo();
            info.Open(file);

            info.Option("Inform", "XML");
            info.Option("Complete");
            return info.Inform().Contains("<track type=\"Menu\"");
        }
开发者ID:Jim-1960,项目名称:mkv-chapterizer,代码行数:9,代码来源:MKVC.cs


注:本文中的MediaInfoLib.MediaInfo.Inform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。