视频播放应用程序c ++ [英] video playing application c++

查看:83
本文介绍了视频播放应用程序c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Visual C ++在同一应用程序中播放两个不同的视频
我不想使用opencv.而且我不希望Callabny播放其他.exe文件.
是否存在任何videobox类的东西,例如picturebox

解决方案

Hm ...添加新的COM组件-> Windows Media Player(正如您提到的图片框"一样,我假设您是在谈论表单,对吧?).在该组件的属性中,您将找到在何处插入视频等的路径...
另外,您可以添加另一个按钮并编写类似以下内容的内容:

 私有:System :: Void button1_Click(System ::  Object  ^发件人,System :: EventArgs ^ e)
{
openFileDialog1-> ShowDialog();
axWindowsMediaPlayer1-> URL = openFileDialog1-> FileName;
} 


希望这会有所帮助..我不知道更好:)


除非您想自己编写所有视频解码和渲染(并且现有的所有视频格式都将是一个项目这可能需要数年的时间!)您必须依靠一些外部组件.

在Windows上,"componet"是媒体播放器"(不要以为您只是在单击该应用程序时就单击图标:只是一个小exe加载了一堆真正起作用的DLL!我"我在谈论DLL本身.

要访问这些DLL,您必须调用它们自己的API,这些API以COM对象的形式表示(因此RKnGI解决方案).

或者,您可以查看 VLC项目 [

hi i want to play two different video in same application using visual c++
i do not want to use opencv. and i dnt want callabny other .exe file forplaying.
is there any videobox kind thing is present like picturebox

解决方案

Hm... Add new COM component -> Windows Media Player (as you mentioned "picturebox" I am assuming you are talking about forms, right ?). In the properties of that component you will find where to insert path to your video etc ...
Also , you could add another button and write something like :

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) 
{
openFileDialog1->ShowDialog();
axWindowsMediaPlayer1->URL = openFileDialog1->FileName;  
}


hope this helps .. I don''t know any better :)


Unless you want to write yourself all the video decoding and rendering (and with all the video format existing will be a project that may take years!) you must rely on some external component.

On windows that "componet" is the "media player" (don''t think to it in term of the application you lauch clicking the icon: that just a small exe loading a bunch of DLLs that do the real job! I''m talking about the DLL themselves).

To access those DLLs you have to call their own API that are expressed in the form fo a COM object (hence RKnGI solution).

As an alternative, you ca look at the
VLC project[^], either as a compoent "a-la mediaplayer" or as a library (you can download the sources) to link to.


这篇关于视频播放应用程序c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆