简体   繁体   English

使用C#播放DVD

[英]playing a dvd using C#

I have a dvd copied in my hard drive. 我的DVD复制到了硬盘中。 It has a folder called video_ts. 它有一个名为video_ts的文件夹。 I am planning to run VLC player to play it. 我打算运行VLC播放器来播放它。 i was wondering how can I play this dvd using c#. 我想知道如何使用C#播放此DVD。 I do not want to use a activex control inside c#. 我不想在C#中使用ActiveX控件。 All I need to do is run the vlc.exe using process. 我需要做的就是使用进程运行vlc.exe。 I have already done that. 我已经这样做了。 But how do I select a specific file from the code that will start playig in the vlc player. 但是我如何从代码中选择一个特定的文件,该文件将在vlc播放器中启动playig。 My code is. 我的代码是。

System.Diagnostics.Process Proc = new System.Diagnostics.Process();
Proc.StartInfo.FileName = @"C:\Program Files\VideoLAN\VLC\vlc.exe";
 Proc.StartInfo.Arguments = @"C:\Test\Legacy\VIDEO_TS\VIDEO_TS.BUP";
 Proc.Start();

I am trying to send the file name as a argument to run it in the vlc.exe . 我正在尝试将文件名作为参数发送来在vlc.exe中运行它。 But its not working. 但是它不起作用。 Its just opening up the vlc player. 它只是打开VLC播放器。 I dont want the user to select the file manually. 我不希望用户手动选择文件。

http://wiki.videolan.org/VLC_command-line_help http://wiki.videolan.org/VLC_command-line_help

From here it seems as if your syntax for the file location needs to be in the form of file://, but I'm not sure. 从这里开始,似乎文件位置的语法需要采用file://的形式,但是我不确定。 Also try using a relative path and see if that works. 另外,请尝试使用相对路径,看看是否可行。

I've never done this before myself, so I'm going by what I've just Googled. 我从来没有做过此事,所以我会按照我刚刚搜索过的内容进行操作。 To start, it looks like you're using the wrong file as your argument. 首先,您似乎使用了错误的文件作为参数。 Check out this page for a description of video_ts contents and what they all mean. 请查看此页面 ,以获取video_ts内容及其所有含义的描述。

Beyond that, take a look at http://www.videolan.org/doc/play-howto/en/ch04.html , which describes command-line parameters for VLC. 除此之外,请访问http://www.videolan.org/doc/play-howto/en/ch04.html ,它描述了VLC的命令行参数。 It may be that you have to provide just the path to the video_ts folder instead of to an individual file within it. 可能您只需要提供video_ts文件夹的路径,而不是其中的单个文件的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM