vlc linux ubuntu,vlc 2.2.6 ubuntu下交叉编译

vlc 编译exe真的是坑啊 弄了3天才好 按照下面的步骤一步步做应该没有问题

其实严格来说官网上的编译步骤是一点问题都没有的 但是对我这种Linux命令不熟悉的人 有一些需要配置的地方 忽略掉 整个程序就编不出来

首先贴上官网编译连接https://wiki.videolan.org/Win32Compile/

接下来自己的步骤

0.环境配置 按照官网的来弄就行了 我用的是ubuntu17 用17 16应该都没问题

apt-get install gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools

apt-get install lua5.2 libtool automake autoconf autopoint make gettext pkg-config

apt-get install qt4-dev-tools qt5-default git subversion cmake cvs

上面这个我后来改成了 不确定是否有必要改 可以先不改

apt-get install qt4-dev-tools qt4-default git subversion cmake cvs

apt-get install wine64-development-tools libwine-dev zip p7zip nsis bzip2

apt-get install yasm ragel ant default-jdk protobuf-compiler dos2unix

1.首先源码的获取一定不能按照官方的来弄(官方的那个最新版本第三方链接有问题) 而是下载指定的2.2.6版本 其他版本我都编译失败了 可能还是我哪个地方没弄好

地址 ftp://ftp.videolan.org/pub/videolan/vlc/2.2.6/

2.下载后解压放到根目录Home中 重命名为vlc 这个后序可以自己调  最后路径是/home/vlc/xx xx xx xx

3.接下来不是特殊的命令不解释 一步一步照着敲就行

cd /home/vlc

mkdir -p contrib/win32

cd contrib/win32

../bootstrap --host=i686-w64-mingw32       (host后面的名称根据32位还是64位 自己变化参照官网 我这里是32位的,不确定64位还有没有坑)

make prebuilt

cd ../../

./bootstrap

mkdir win32 && cd win32

export PKG_CONFIG_LIBDIR=$HOME/vlc/contrib/i686-w64-mingw32/lib/pkgconfig    这个命令注意了 路径就是你的vlc路径

../configure --host=i686-w64-mingw32 --build=x86_64-pc-Linux-gnu

make -j2   参数-j2是双处理器编译的意思 可以不用

make package-win-common

cd vlc-2.2.6

wine vlc.exe

一般错误都会处在./configure  make这两个阶段 像是什么libavcodec qt QWidget/QAction no such file之类的错误 大部分原因一个是vlc源码的版本 一个是上面位置 参数配置的问题  严格按照上面的步骤编译的话 应该是没有问题

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
//创建初始化播放器资源 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] extern public static IntPtr libvlc_new(int argc, IntPtr argv); //创建播放器实例 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_player_new(IntPtr libvlc_instance); // 释放libvlc实例 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_release(IntPtr libvlc_instance); //获取库版本信息 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern String libvlc_get_version(); // 从视频来源(例如Url)构建一个libvlc_meida RTSP [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_new_location(IntPtr libvlc_instance, IntPtr path); // 从本地文件路径构建一个libvlc_media rtsp串流不适合调用此接口 // [MarshalAs(UnmanagedType.LPStr)] string path [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_new_path(IntPtr libvlc_instance, IntPtr path); /// <summary> /// 影片长度 /// </summary> /// <param name="libvlc_instance"></param> /// <returns></returns> [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr libvlc_media_player_get_length(IntPtr libvlc_media_player); //释放对象 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_release(IntPtr libvlc_media_inst); // 将视频(libvlc_media)绑定到播放器上 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_set_media(IntPtr libvlc_media_player, IntPtr libvlc_media); //创建(libvlc_media)播放窗口 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_new_from_media(IntPtr libvlc_media_player); // 设置图像输出的窗口 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_set_hwnd(IntPtr libvlc_mediaplayer, Int32 drawable); //播放 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_play(IntPtr libvlc_mediaplayer); //暂停 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_pause(IntPtr libvlc_mediaplayer); //停止 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_stop(IntPtr libvlc_mediaplayer); // 解析视频资源的媒体信息(如时长等) [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_parse(IntPtr libvlc_media); // 返回视频的时长(必须先调用libvlc_media_parse之后,该函数才会生效) [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern Int64 libvlc_media_get_duration(IntPtr libvlc_media); // 当前播放的时间 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern Int64 libvlc_media_player_get_time(IntPtr libvlc_mediaplayer); // 设置播放位置(拖动) [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_set_time(IntPtr libvlc_mediaplayer, Int64 time); /// <summary> /// 抓图 /// </summary> /// <param name="libvlc_mediaplayer"></param> /// <param name="num">经典0</param> /// <param name="filePath">完整路径,文件名英文或下划线开头</param> /// <param name="i_width"></param> /// <param name="i_height"></param> /// <returns></returns> [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern int libvlc_video_take_snapshot(IntPtr libvlc_mediaplayer, uint num, IntPtr filePath, uint i_width, uint i_height); //media player release [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_media_player_release(IntPtr libvlc_mediaplayer); // 获取音量 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern int libvlc_audio_get_volume(IntPtr libvlc_media_player); //设置音量 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_audio_set_volume(IntPtr libvlc_media_player, int volume); // 设置全屏 [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern void libvlc_set_fullscreen(IntPtr libvlc_media_player, int isFullScreen); /// <summary> ///判断是否可以录像 /// </summary> /// <param name="libvlc_mediaplayer"></param> /// <returns></returns> //Can the media player record the current media? [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern bool libvlc_media_player_is_recordable(IntPtr libvlc_media_player); /// <summary> ///判断是否在录像 /// </summary> /// <param name="libvlc_mediaplayer"></param> /// <returns></returns> [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern bool libvlc_media_player_is_recording(IntPtr libvlc_media_player); /// <summary> /// 录像开始 /// </summary> /// <param name="libvlc_mediaplayer"></param> /// <param name="psz_PathFilename">保存路径+文件名(d:\\record (将在D盘根目录保存为record.mp4))</param> /// <returns></returns> [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern int libvlc_media_player_record_start(IntPtr libvlc_media_player, IntPtr psz_PathFilename); /// <summary> /// 录像停止 /// </summary> /// <param name="libvlc_mediaplayer"></param> /// <returns></returns> [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)] public static extern int libvlc_media_player_record_stop(IntPtr libvlc_media_player);

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值