VLC学习(1)—— window下SDK使用
2016-05-31 21:43
218 查看
1.到http://www.videolan.org/ 下载最新的vlc
windows版本,我下的是vlc2.1.0
2.安装解压
3.在网上找到stdint.h 放到C:\Program Files\Microsoft Visual Studio 9.0\VC\include下
4.建立vs2010的win32工程
5.到vlc的安装目录下将sdk拷贝到建立的win32工程目录下,设置头文件和库的目录
6.在代码里
windows版本,我下的是vlc2.1.0
2.安装解压
3.在网上找到stdint.h 放到C:\Program Files\Microsoft Visual Studio 9.0\VC\include下
4.建立vs2010的win32工程
5.到vlc的安装目录下将sdk拷贝到建立的win32工程目录下,设置头文件和库的目录
6.在代码里
#include <time.h> #include <stdio.h> #include <vlc.h> #include <libvlc.h> #include <Windows.h> #include <WinUser.h> #include <libvlc_media.h> #include <libvlc_media_player.h> #pragma comment(lib,"libvlc.lib") #pragma comment(lib,"libvlccore.lib") int main(int argc, char** argv) { libvlc_instance_t * inst; libvlc_media_player_t *mp; libvlc_media_t *m; libvlc_time_t length; int width; int height; int wait_time = 5000; //libvlc_time_t length; /* Load the VLC engine */ inst = libvlc_new(0, NULL); //Create a new item //Method 1: //m = libvlc_media_new_location (inst, "file:///F:\\movie\\cuc_ieschool.flv"); //Screen Capture //m = libvlc_media_new_location (inst, "screen://"); //Method 2: m = libvlc_media_new_path(inst, "D:\\sanming\\ASI\\610.ts"); /* 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); // play the media_player libvlc_media_player_play(mp); //wait until the tracks are created Sleep(wait_time); length = libvlc_media_player_get_length(mp); width = libvlc_video_get_width(mp); height = libvlc_video_get_height(mp); printf("Stream Duration: %ds\n", length / 1000); printf("Resolution: %d x %d\n", width, height); //Let it play Sleep(length - wait_time); // Stop playing libvlc_media_player_stop(mp); // Free the media_player libvlc_media_player_release(mp); libvlc_release(inst); return 0; }
相关文章推荐
- 介绍一款信息管理系统的开源框架---jeecg
- 源码被倒卖,大厂薅羊毛,开源真的只能被予取予求?
- 专家解读:开源软件项目是否会被限制出口?
- Android ADT 23.0.0无法更新到23.0.2问题解决方案
- 专家解读:开源软件项目是否会被限制出口?
- fuse-dfs的设定手册
- Centos下***(pptpd)的部署
- SDKMAN:轻松管理多个软件开发套件 (SDK) 的命令行工具
- 开源MySQL高效数据仓库解决方案:Infobright详细介绍
- Parse正式发布开源PHP SDK
- 国外比较好的几个的Php开源建站平台小结
- 开源SNS系统-ThinkSNS
- 基于Android SDK-在64位Linux中使用需要注意的问题
- Android编程之SDK安装组件的离线安装方法分享
- C#调用Nero SDK刻录光盘的方法
- 推荐几个开源的微信开发项目
- 使用科大讯飞语音SDK实现文字在线合成语音
- 开源电商app常用标签"hot"之第三方开源LabelView
- 在Android Studio中使用BaiduMap SDK实时获取当地位置信息