简体   繁体   English

在C ++项目中使用LibVLC [Mac OS X-Xcode]

[英]using LibVLC in C++ Project [Mac OS X - Xcode]

I am writing an application that catch a stream video from a wifi camera and I am using LibVLC to retrieve the video. 我正在编写一个从wifi摄像头捕获流视频的应用程序,并且正在使用LibVLC检索视频。

So, before implementing my application, I have tested LibVLC with the example code, but it crashes on function libvlc_media_new_location 因此,在实现我的应用程序之前,我已经使用示例代码测试了LibVLC,但是它在函数libvlc_media_new_location上崩溃

I am using this Framework on Mac OS X El Capitan with Xcode, the dialect of C++ is std=c++11 and libc++ (LLVM). 我在Mac OS X El Capitan和Xcode上使用了这个Framework,C ++的方言是std = c ++ 11和libc ++(LLVM)。

This is the example code that doesn't work: 这是无效的示例代码:

libvlc_instance_t * inst;
libvlc_media_player_t *mp;
libvlc_media_t *m;

/* Load the VLC engine */
inst = libvlc_new (0, NULL);

/* Create a nxxew item, this is the line that crashes*/
m = libvlc_media_new_location (inst, "http://mycool.movie.com/test.mov"); 

/* Create a media player playing environement */
mp = libvlc_media_player_new_from_media (m);

/* No need to keep the media now */
libvlc_media_release (m);

Could you help me please ? 请问你能帮帮我吗 ? Thanks in advance for response. 预先感谢您的回复。

One possible reason could be the bug in libvlc 2.2.x which not allow use it outside VLC.app (due to fail load plugins, since plugins try search libvlccore.dylib in wrong place). 一个可能的原因可能是在错误libvlc 2.2.x的这不允许使用它以外VLC.app (由于无法加载插件,因为插件尝试搜索libvlccore.dylib在错误的地方)。 As workaround you should use slightly modified VLC tree. 解决方法是,您应使用略微修改的VLC树。 You could get it already prepared from one of my projects . 您可以从我的一个项目中准备好它。

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

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