在Ubuntu下编译VLC源代码生成的VLC无法播放Youtube视频(比如https://www.youtube.com/watch?v=mDp-ABzpRX8)

错误提示如下:

  1. zlf@ubuntu:~/vlc-2.1.$ ./vlc
  2. VLC media player 2.1. Rincewind (revision 2.1.--gdab6cb5)
  3. [0x9872a98] main libvlc: 正在以默认界面运行 vlc,使用 'cvlc' vlc 运行在无界面的状态下。
  4. [0x9931448] main tls client error: TLS client plugin not available
  5. [0xb5d034d8] main input error: open of `https://www.youtube.com/watch?v=mDp-ABzpRX8' failed

原因是缺少TLS客户端插件,因此需要将GnuTLS库编译进来。

这里下载GnuTLS库的最新版本3.3.12,configure时报错,显示缺少依赖库Libnettle,而且只能适配2.7.1,nettle3.0还不行。

  1. zlf@ubuntu:~/gnutls-3.3.$ ./configure --prefix=/usr
  2. configure: error:
  3. ***
  4. *** Libnettle 2.7. was not found. Note that this version of gnutls doesn't support nettle 3.0.

又去下载NETTLE库,编译安装,再运行GnuTLS的configure,NETTLE倒是检查通过,但依然报错,还需要HOGWEED库和GMP。

  1. zlf@ubuntu:~/gnutls-3.3.$ ./configure --prefix=/usr
  2. ..................
  3. checking for NETTLE... yes
  4. checking for HOGWEED... no
  5. configure: error:
  6. ***
  7. *** Libhogweed (nettle's companion library) was not found. Note that you must compile nettle with gmp support.
下载GMP库,编译安装:How to Install GMP in Ubuntu
下载HOGWEED库,编译安装。
然后,需要重新配置安装NETTLE,可以参考这篇文章(遇到了一模一样的问题)。
再再次重新配置编译GnuTLS,

configure正常通过,但make时又报错了,典型的undefined reference to的error问题。
 
 
  1. ../lib/.libs/libgnutls.so: undefined reference to `nettle_umac96_set_key'
  2. ../lib/.libs/libgnutls.so: undefined reference to `nettle_salsa20_crypt'
  3. ../lib/.libs/libgnutls.so: undefined reference to `nettle_umac128_update'
  4. ../lib/.libs/libgnutls.so: undefined reference to `nettle_umac96_set_nonce'
  5. ../lib/.libs/libgnutls.so: undefined reference to `nettle_salsa20_set_key'
  6. ../lib/.libs/libgnutls.so: undefined reference to `nettle_umac128_set_nonce'
  7. ../lib/.libs/libgnutls.so: undefined reference to `nettle_umac128_set_key'
  8. ../lib/.libs/libgnutls.so: undefined reference to `nettle_umac96_digest'
  9. ../lib/.libs/libgnutls.so: undefined reference to `nettle_salsa20_set_iv'
  10. ../lib/.libs/libgnutls.so: undefined reference to `nettle_umac128_digest'
  11. ../lib/.libs/libgnutls.so: undefined reference to `nettle_salsa20r12_crypt'
  12. ../lib/.libs/libgnutls.so: undefined reference to `nettle_umac96_update'
  13. collect2: ld returned exit status
  14. make[]: *** [psktool] Error
  15. make[]: Leaving directory `/home/zlf/gnutls-3.3./src'
  16. make[]: *** [all-recursive] Error
  17. make[]: Leaving directory `/home/zlf/gnutls-3.3./src'
  18. make[]: *** [all] Error
  19. make[]: Leaving directory `/home/zlf/gnutls-3.3./src'
  20. make[]: *** [all-recursive] Error
  21. make[]: Leaving directory `/home/zlf/gnutls-3.3.'
  22. make: *** [all] 错误

尝试了一些方法没搞定,只好求助Linuxfromscratch网站了,跟着上面的安装指导操作。

configure时需要指定根证书,但本机上没有/etc/ssl/ca-bundle.crt,因此需要去http://certifie.com/ca-bundle/下载一个现成的或自己制作一个。

  1. ./configure --prefix=/usr --with-default-trust-store-file=/etc/ssl/ca-bundle.crt

configure成功后make又报错了。

  1. /home/zlf/gnutls-3.3./build-aux/missing: line : makeinfo: command not found
  2. WARNING: 'makeinfo' is missing on your system.
  3. You should only need it if you modified a '.texi' file, or
  4. any other file indirectly affecting the aspect of the manual.
  5. You might want to install the Texinfo package:
  6. <http://www.gnu.org/software/texinfo/>
  7. The spurious makeinfo call might also be the consequence of
  8. using a buggy 'make' (AIX, DU, IRIX), in which case you might
  9. want to install GNU make:
  10. <http://www.gnu.org/software/make/>
  11. make[]: *** [gnutls.info] Error
  12. make[]: Leaving directory `/home/zlf/gnutls-3.3./doc'
  13. make[]: *** [all-recursive] Error
  14. make[]: Leaving directory `/home/zlf/gnutls-3.3./doc'
  15. make[]: *** [all] Error
  16. make[]: Leaving directory `/home/zlf/gnutls-3.3./doc'
  17. make[]: *** [all-recursive] Error
  18. make[]: Leaving directory `/home/zlf/gnutls-3.3.'
  19. make: *** [all] 错误

原因是没有makeinfo命令,安装texinfo。

  1. zlf@ubuntu:~$ makeinfo
  2. 程序“makeinfo”尚未安装。 您可以使用以下命令安装:
  3. sudo apt-get install texinfo
  4. zlf@ubuntu:~$ sudo apt-get install texinfo

终于make GnuTLS成功了。

make check也PASS了。

最后是sudo make install,OK!

终于安装好了GnuTLS库,可以继续编译VLC了,VLC的configure中默认是使能GnuTLS的,因此configure后直接make。

这次用的是专业安装指导

但安装后的VLC并没有GnuTLS的插件(VLC-工具-插件及扩展-插件)!还是没有将其编译进去?

检查GnuTLS的configure,发现configure找到的GnuTLS版本是2.12.14,并非自己安装的最新的3.3.12。

  1. zlf@ubuntu:~/gnutls-3.3.$./configure --enable-gnutls
  2. ......
  3. checking for GNUTLS... no
  4. configure: error: Requested 'gnutls >= 3.0.20' but version of GnuTLS is 2.12.
  5. You may find new versions of GnuTLS at http://www.gnu.org/software/gnutls/.)

确认了一下自己下载的GnuTLS的版本,确实是3.3.12。

  1. zlf@ubuntu:~/gnutls-3.3.$ ./configure --version
  2. GnuTLS configure 3.3.
  3. generated by GNU Autoconf 2.69
  4.  
  5. zlf@ubuntu:~$ pkg-config --modversion gnutls
  6. 3.3.

又确认了一下安装到/usr/lib下的GnuTLS的版本,也是3.3.12。

  1. zlf@ubuntu:/usr/lib/pkgconfig$ vim gnutls.pc
  2. 显示gnutlsVersion: 3.3.

最后在Ubuntu软件中心里发现了旧版的GnuTLS 2.12.14,将其卸载。

继续configure,继续报错,这次是缺少新版本的libgcrypt。

  1. checking whether GCRYCTL_SET_THREAD_CBS is declared... no
  2. configure: error: libgcrypt version 1.1. or higher not found. Install libgcrypt or use --disable-libgcrypt. Have a nice day.

GNUPG官网下载libgcrypt的TAR包,解压配置编译安装。

继续configure,继续报错,这次是缺少新版本的libgpg-error。同上搞定。

configure终于通过!

开始make,报错。

  1. make[]: 正在进入目录 `/home/zlf/vlc-2.1./modules/misc'
  2. CC libxml_plugin_la-libxml.lo
  3. CCLD libxml_plugin.la
  4. CC libexport_plugin_la-html.lo
  5. CC libexport_plugin_la-m3u.lo
  6. CC libexport_plugin_la-xspf.lo
  7. CC libexport_plugin_la-export.lo
  8. CCLD libexport_plugin.la
  9. CC libgnutls_plugin_la-gnutls.lo
  10. gnutls.c::: 致命错误: gnutls/gnutls.h:没有那个文件或目录
  11. 编译中断。
  12. make[]: *** [libgnutls_plugin_la-gnutls.lo] 错误
  13. make[]:正在离开目录 `/home/zlf/vlc-2.1./modules/misc'
  14. make[]: *** [all] 错误
  15. make[]:正在离开目录 `/home/zlf/vlc-2.1./modules/misc'
  16. make[]: *** [all-recursive] 错误
  17. make[]:正在离开目录 `/home/zlf/vlc-2.1./modules'
  18. make[]: *** [all-recursive] 错误
  19. make[]:正在离开目录 `/home/zlf/vlc-2.1.'
  20. make: *** [all] 错误

打开gnutls.c看了下,发现需要gnutls/gnutls.h和gnutls/x509.h两个头文件,将它们拷贝至/usr/include下。

  1. zlf@ubuntu:~/gnutls-3.3./lib/includes/gnutls/$ sudo cp gnutls.h x509.h /usr/include/gnutls

继续make,继续报错,这次又缺少头文件combat.h,继续拷贝。

  1. zlf@ubuntu:~/gnutls-3.3./lib/includes/gnutls/$ sudo cp compat.h /usr/include/gnutls

继续make,成功!

make check,PASS!

打开VLC,检查插件设置,终于有TLS了。

总结:

1、Ubuntu可以使用apt-get命令直接下载安装软件包,也可以下载压缩包然后解压配置编译安装,后者可以自由决定软件包版本;
2、每个软件下几乎都有README文档和INSTALL文档,遇到问题先去看下,没坏处;
3、每个软件或命令都有--help选项,遇到问题先去看下,没坏处;
4、折腾过程中根据错误提示,看帮助看代码,网上搜索,一步一步解决。

VLC编译问题的更多相关文章

  1. vlc 编译

    一.有用的网址: https://forum.videolan.org/search.php 二.只编译Java apk部分: source env.shmake distcleanmake -e 编 ...

  2. IOS VLC编译步骤(包含移植和截图功能)

    http://blog.csdn.net/Kan_Crystal/article/details/40424673 一.下载源码 先到VLC官网将源码下载到本机,以下链接为官网编译操作地址:https ...

  3. VLC编译

    http://blog.csdn.net/hdh4638/article/details/7602321 1 下载代码 ki.videolan.org/VLC_Source_code git colo ...

  4. VLC 重新编译第三方库的预编译包contrib

    VLC的引用了很多开源的第三方库,均放到VLC目录下的contrib中(本来开始编译是2.1.x以上版本,以前或以后可能会变化),在Windows版本编译中,contrib文件夹中仅仅下载VLC官网上 ...

  5. 基于vlc sdk的二次开发--环境搭建、编译

    前言 关于 搭建.编译VLC,不同的平台有不同的方法,可以参考wiki. 其中在windows下编译VLC有两种方式,MSYS+MinGW和CygWin.通过测试,最后决定采用MSYS+MinGW搭建 ...

  6. VLC说明

    一.简介 vlc的全名是Video Lan Client,是一个开源的.跨平台的视频播放器.VLC支持大量的音视频传输.封装和编码格式,完整的功能特性列表可以在这里获得http://www.video ...

  7. vlc

    源码下载地址:http://download.videolan.org/pub/videolan/vlc/ 编译依赖: sudo apt-get install liblua5.2-dev sudo ...

  8. VLC框架分析

      功能部份:VLC媒体播放器的核心是libvlc ,它提供了界面,应用处理功能,如播放列表管理,音频和视频解码和输出,线程系统.所有libvlc源文件设在的/src目录及其子目录:# config/ ...

  9. vlc的应用之二:vlc的ActiveX及cab

    请移步https://higoge.github.io/,所有下载资料在那个博客都能找到.谢谢. http://jeremiah.blog.51cto.com/ 2009-05-14补充:8. Act ...

随机推荐

  1. 使用Visual Studio Code开发Asp.Net Core WebApi学习笔记(四)-- Middleware

    本文记录了Asp.Net管道模型和Asp.Net Core的Middleware模型的对比,并在上一篇的基础上增加Middleware功能支持. 在演示Middleware功能之前,先要了解一下Asp ...

  2. POJ C程序设计进阶 编程题#2: 配对碱基链

    编程题#2: 配对碱基链 来源: POJ (Coursera声明:在POJ上完成的习题将不会计入Coursera的最后成绩.) 注意: 总时间限制: 1000ms 内存限制: 65536kB 描述 脱 ...

  3. Vue.js学习 Item6 -- Class 与 样式绑定

    数据绑定一个常见需求是操作元素的 class 列表和它的内联样式.因为它们都是 attribute,我们可以用 v-bind 处理它们:只需要计算出表达式最终的字符串.不过,字符串拼接麻烦又易错.因此 ...

  4. Vue.js学习 Item1 --快速入门

    我们以 Vue 数据绑定的快速导览开始.如果你对高级概述更感兴趣,可查看这篇博文. 尝试 Vue.js 最简单的方法是使用 JSFiddle Hello World 例子.在浏览器新标签页中打开它,跟 ...

  5. 3种方式实现Java多线程

    java中实现多线程的方法有两种:继承Thread类和实现runnable接口. 1.继承Thread类,重写父类run()方法 public class thread1 extends Thread ...

  6. php分页代码实例

    $result = "<div class=\"page-num\"><ul class=\"fn-clear\">" ...

  7. 【easyui】--combobox--赋值和获取选中的值

    //初始化下拉选框 $('#communityIdDiv').combobox({ url:basepath+"pushController/queryCommonityName" ...

  8. FileOutputSream

    package cd.itcast.fileinputstream; import java.io.File; import java.io.FileNotFoundException; import ...

  9. 【转】MessageBox

    MessageBox对话框是比较常用的一个信息对话框,其不仅能够定义显示的信息内容.信息提示图标,而且可以定义按钮组合及对话框的标题,是一个功能齐全的信息对话框. 1.函数原型及参数 function ...

  10. 全排列 (codevs 1294)题解

    [题目描述] 给出一个n, 请输出n的所有全排列(按字典序输出). [样例输入] 3 [样例输出] 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1 [解题思路] 听说C++有作 ...