上一篇文章介绍了如何交叉编译 FFmpeg ,继续介绍  VLC播放器  交叉编译 。

首先下载 vlc 源码  我用的是 2.2.6  地址 : http://mirrors.neusoft.edu.cn/videolan/vlc/2.2.6/vlc-2.2.6.tar.xz  解压,进入目录。

然后  设置 ffmpeg路径  ,上一章把ffmpeg 装在了   --prefix=/exports/rfs/usr   对应得在 交叉工具 脚本 中添加

export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib64/pkgconfig:/exports/rfs/usr/lib64/pkgconfig

source 你的交叉编译脚本。

然后  执行  ./bootstrapped   (关键 )

继续 configure

./configure --host=aarch64-poky-linux --prefix=/exports/rfs/usr --enable-run-as-root GL_LIBS="-lGLESv2"  --disable-debug --disable-lua --disable-qt --disable-ogg --disable-mux_ogg --disable-pulse --disable-xcb --disable-vorbis  --disable-mtp --disable-dbus --disable-mmx --disable-sse  --disable-notify  --disable-live555 --disable-dc1394 --disable-dvdnav --disable-libcddb --disable-vcd --disable-mod --disable-mpc --disable-gme  --disable-mad  --disable-postproc --disable-libtar --disable-dca --disable-zvbi --disable-xcb --disable-freetype --disable-fontconfig --disable-libxml2 --disable-skins2 --disable-qt --disable-atmo  --disable-screen  --disable-wma-fixed --disable-oss  --disable-pulse  --disable-alsa  --disable-upnp  --disable-ncurses --disable-libgcrypt --disable-gnutls --disable-speex  --disable-schroedinger  --disable-fluidsynth  --disable-kate  --disable-tiger --disable-bonjour --disable-jack  --disable-dv1394 --disable-dvdread --disable-bluray --disable-linsys --disable-samplerate --disable-libass --disable-theora --disable-twolame --disable-udev --disable-svg --disable-opencv --disable-caca --disable-gnomevfs --disable-flac --disable-gst-decode

里面的库可以根据自己的需要添加 或者删除 可以  通过  ./configure --help  | grep  enable 查看

中途可能出现  libavcodec versions 56 and later are not supported yet  , 因为 ffmpeg 版本太新  vlc 还不兼容  ,解决办法是下一个版本低的ffmpeg  比如 2.8.13

也可能出现  FFmpeg 错误 C4996: "avcodec_alloc_frame   因为  ffmpeg 库 版本不一致

也可能 出现    libtool: link: warning: library `XXXXX.la' was moved.  因为 上面说的 PKG_CONFIG_PATH  中添加缺失的库路径 或者   在configure 中  --disalbe-报错的库

也可能出现   libgcrypy support     解决 方法  : apt-get install libgcrypt-dev

可能出现  找不到  -lGL   需要指明  GL_LIBS="-lGLESv2"  使用 嵌入式 opengl  glesv2 版本

成功出现

libvlc configuration
--------------------
version : 2.2.
system : linux
architecture : aarch64
optimizations : yes
vlc aliases : cvlc rvlc

会在 目录中出现   aarch64-poky-linux-libtool  可执行文件 。

更改名字

root@ubuntu:/vlc-2.2.# cp aarch64-poky-linux-libtool libtool

然后就是 长长的make了

make

可能出现  error: #error \MB_LEN_MAX wrong\

  toolchains/。。。。/include/bits/stdlib.h中 将

  #define STDLIB_MB_LEN_MAX 16 改为

  #define STDLIB_MB_LEN_MAX 1

或者 没定义  SSIZE_MAX  # define SSIZE_MAX 32767

可能出现  libavformat /avformat .h     No such file  需要把  /exports/rfs/usr   中的关于ffmpeg 的 include lib share 等拷贝到交叉工具链中。

可能出现  VLC is not supposed to be run as root. Sorry.

If you need to use real-time priorities and/or privileged TCP ports

you can use vlc-wrapper (make sure it is Set-UID root and

cannot be run by non-trusted users first).

只能重新编译安装,configure的时候加 --enable-run-as-root

可能出现

core libvlc error: No plugins found! Check your VLC installation

因为 编译好vlc 之后 没有正确安装 把--prefix 设置  根文件系统 下 /usr/

make

make  install

完成

参考  http://sacarin.egloos.com/3103511

Cross compile VLC for ARM-based platforms
Last updated: v0.0.2, march
This document describes all the steps to cross compile vlc for ARM based platforms. It describes how to build a cross compilation toolchain, how to build the libraries needed by vlc and the compilation of the vlc itself. Introduction
This document is only a first draft. It does not intend to cover all subjects and is written for vlc version 0.7.. You may still have some problems at some steps or find better way to do them. If you have any comment do not hesitate to contact us. Which platforms are targeted ?
I will describe here how to compile vlc for an ARM based PDA running linux. It includes for example : Compaq - iPaq (H36xx, H38xx,...), using Familiar Linux
GNU Portable Environment (GPE)
Opie
YOPY/Linupy
Zaurus Requirements for cross-compilation
Why cross-compiling ?
It is of course possible to compile directly on the targeted platform. But there are a lot of great advantages to cross-compile : The most important one is probably the speed, because a desktop computer is most of the time faster than a PDA for compilation.
Another big problem is that a complete compilation toolchain does take a great amount of disk space. And this space is usually very limited on embedded systems.
And there also may not be enough memory to compile big files. Building the toolchain
Prerequisite
Importants paths
During this section, we will use the following paths : I would personally advise to compile everything as a normal user and then install everything as root. ${SRCDIR}
This is where the sources will be located and where the compilation will be done. (eg: /usr/src or /home/foobar/arm-src). ${PREFIX}
This is where you want to install your cross compilation toolchain. It can be either installed system-wide (in /usr/local/arm/2.95. for example). Installation steps (i.e. make install) will have to be done as root. Or it can be installed in user-land, for the user's own use (/home/foobar/arm/2.95.3 for example). In this paper, the chosen prefix is /usr/local/arm/2.95.3, you will have to adapt the commands to what you choose.. Files needed
Download the following files and put them in the ${SRCDIR}. Most of them are available on the "VideoLAN website" binutils-2.11..tar.gz
linux-2.4..tar.bz2
patch-2.4.-rmk4.bz2
gcc-2.95..tar.gz
gcc-2.95..diff.bz2
gcc-2.95..diffbis.bz2
gcc-2.95..diff2
glibc-2.2..tar.gz
glibc-linuxthreads-2.2..tar.gz
SDL-1.2..tar.gz
glib-1.2..tar.gz
ffmpeg.tar.gz
mad-0.14.2b.tar.gz
flac-1.1..tar.gz
libdvbpsi-0.1..tar.gz
a52dec-0.7..tar.gz Binutils
Compiling binutils is pretty simple :
tar -xzf binutils-2.11..tar.gz
cd binutils-2.11.
./configure --target=arm-linux --prefix=/usr/local/arm/2.95.
make
make install Preparing linux kernel
Before building the glibc library the right kernel header files should be available. Therefor the kernel that is going to be used needs to be prepared so all necessary header files are present. Follow these steps.
tar -xzf linux-2.4..tar.bz2
bunzip2 patch-2.4.-rmk4.bz2
cd linux-2.4.
make mrproper
patch -p1 < ../patch-2.4.-rmk4.bz2
make clean ARCH=arm CROSS_COMPILE=arm-linux-
make ARCH=arm h3600_config Do not forget to save the configuration even if no changes are made !
make ARCH=arm menuconfig
make symlinks ARCH=arm CROSS_COMPILE=arm-linux-
mkdir -p /usr/local/arm/2.95./arm-linux/include
cp -Rf include/asm include/asm-arm include/linux \
/usr/local/arm/2.95./arm-linux/include
cd /usr/local/arm/2.95./arm-linux
ln -s include sys-linux Basic cross compiler (gcc)
tar -xvzf gcc-2.95..tar.gz
bunzip2 gcc-2.95..diff.bz2
bunzip2 gcc-2.95..diffbis.bz2
patch -p1 -d gcc-2.95. < gcc-2.95..diff
patch -p1 -d gcc-2.95. < gcc-2.95..diffbis
cd gcc-2.95.
./configure --target=arm-linux --disable-threads --enable-languages=c \
--prefix=/usr/local/arm/2.95. --with-headers=linux-2.4./include
make
make install Compiling glibc
Depending on your target, you may choose another glibc version (eg: 2.1. for linupy 1.4)
tar -xvzf glibc-2.2..tar.gz
cd glibc-2.2.
tar -xvzf ../glibc-linuxthreads-2.2..tar.gz
CC=arm-linux-gcc ./configure arm-linux --target=arm-linux \
--prefix=/usr/local/arm/2.95./arm-linux --enable-add-ons The following step takes quite a long time!
CC=arm-linux-gcc make If you have problems compiling glibc due to pread/pwrite, edit sysdeps/unix/sysv/linux/kernel-features.h and turn __ASSUME_PREAD_SYSCALL and __ASSUME_PWRITE_SYSCALL from to .
CC=arm-linux-gcc make install Full cross compiler (gcc)
Now it is time to build a cross-compiler that can built user space libraries too. Follow these steps:
rm -Rf gcc-2.95.
tar -xvzf gcc-2.95..tar.gz
patch -p1 -d gcc-2.95. < gcc-2.95..diff
patch -p1 -d gcc-2.95. < gcc-2.95..diff2
cd gcc-2.95.
./configure --target=arm-linux --prefix=/usr/local/arm/2.95.
make
make install Misc
Add /usr/local/arm/2.95./bin to your PATH. Add the following line (depends on your shell) to your shell's configuration file :
export PATH=/usr/local/arm/2.95./bin:$PATH I would advise you to completely log out and then log in again, so that the change would be taken into account. You can now check that when you type arm-linux-gcc, it launches the cross-compiler. Next are some packages that you may compile by yourself, but I found it was easier to use the precompiled packages. You can take them at "ipkgfind">. You may find packages with other version numbers which should not be a problem. libgcc1_3.1.1-1_arm.ipk This provides libgcc.so. which is needed to compile some libraries.
xlibs_4.-5_arm.ipk, xlibs-dev_4.1.0-16_arm.ipk Those are the libraries ans the development files for X windows.
zlib1g_1.1.4-3_arm.ipk, zlib1g-dev_1.1.3-fam1_arm.ipk These libraries are needed by some libraries to compile.
Install these packages on your compiler box in /usr/local/arm/2.95./arm-linux : You can use the script install.sh :
#!/bin/sh
# script to install .ipk into the arm-toolchain
# usage : ./install.sh foobar.ipk if ! tar -xvzf $ > /dev/null
then
ar xv $ > /dev/null
fi
cp data.tar.gz /usr/local/arm/2.95./arm-linux
cd /usr/local/arm/2.95./arm-linux
tar -xvzf data.tar.gz Setting up Opie cross-compile environment
Download the Opie SDK from the website "OPIE website" using the menuitem "Download Opie SDK" or try the direct link here: "Download Opie SDK". Download all files to your ${SOURCES}/opie directory. Opie SDK
The Opie SDK does not come with a README file or installation instructions. I give them here instead. There are two tar files in the download a OpieSDK.tar.gz2 and a kdevelop_src.tar.bz2. The last file is a modified kdevelop for use with the OpieSDK. In this tutorial we will not use that. Unpack OpieSDK.tar.bz2 in your sources cd ${SOURCES}/opie directory.
cd ${SOURCES}/opie
tar -xjvf OpieSdk.tar.bz2 It creates a directories structure ${SOURCES}/opie/opt/OpieSDK. Inside that directory a script is present to start_kdevelop. Modify this script so that it uses the correct paths for you setup.
#!/bin/sh
source ${SOURCES}/opie/opt/OpieSdk/dev_env export KDEDIR=${SOURCES}/opie/opt/OpieSdk/kde
export PATH=${SOURCES}/opie/opt/OpieSdk/kde/bin:$PATH
kbuildsycoca
kdevelop Save the script. Do the same with the script arm_source
source ${SOURCES}/opie/opt/OpieSdk/dev_env
export QTDIR=$QTDIR_ARM
export OPIEDIR=$OPIEDIR_ARM Save the script and modify the script host_source in the same manner as above.
source ${SOURCES}/opie/opt/OpieSdk/dev_env
export QTDIR=$QTDIR_NAT
export OPIEDIR=$OPIEDIR_NAT Save the script and modify the script dev_env in the same manner as above.
export PYTHONPATH=${SOURCES}/opie/opt/OpieSdk/python/opie:${SOURCES}/opie/opt/OpieSdk/python/sip
export PATH=/usr/local/arm/2.95./bin:/opt/OpieSdk/host_tools:${SOURCES}/opie/opt/OpieSdk/opie/x86/qt-2.3./bin:$PATH
export PATH=${SOURCES}/opie/opt/OpieSdk/opie/x86/qmake:$PATH
export QTDIR_NAT=${SOURCES}/opie/opt/OpieSdk/opie/x86/qt-2.3.
export OPIEDIR_NAT=${SOURCES}/opie/opt/OpieSdk/opie/x86/sdk
export QTDIR_ARM=${SOURCES}/opie/opt/OpieSdk/opie/arm/qt-2.3.
export OPIEDIR_ARM=${SOURCES}/opie/opt/OpieSdk/opie/arm/sdk
export OPIE_SDK_BASE=${SOURCES}/opie/opt/OpieSdk/
export OPIE_SDK_QMAKE_BASE=${SOURCES}/opie/opt/OpieSdk/opie/x86/sdk/mkspecs/qws/
export OPIE_DOC=${SOURCES}/opie/opt/OpieSdk/apidocs export LD_LIBRARY_PATH=${SOURCES}/opie/opt/OpieSdk/sip/lib:$OPIEDIR_NAT/lib:$QTDIR_NAT/lib:$LD_LIBRARY_PATH
export OPIE_LANGUAGES=de:en:cz:da:dk:es:fr:hu:it:ja:ko:lv:mk:nl:no:pl:pt:pt_BR:ru:sl:zh_CN:zh_TW The symbolic linke to the tool qmake points now to the wrong place. We need to fix this symbolic link. Here is the way to do that.
cd host_tools
ln -sf ${SOURCES}/opie/opt/OpieSdk/opie/x86/sdk/qmake/qmake qmake
cd ../ Now it is time to fire up our development environment and start hacking in Opie. Cross compiling libraries needed by vlc
Download ipaq-config.site to ${SOURCES}. When downloading source tarballs copy them to your ${SOURCES} directory. Each section is supposed to begin with cd ${SOURCES}. SDL
It is not clean at all but did not found a better working method. Using config.site it compiles well, but when linking with vlc there are problems ! /usr/local/arm/2.95./arm-linux/bin should contain the cross compiler without the prefix arm-linux-.
tar -xvzf SDL-1.2..tar.gz
cd SDL-1.2.
./configure --enable-release --target=arm-linux --host=arm-linux \
--disable-esd \
--prefix=/usr/local/arm/2.95./arm-linux/usr \
--x-includes=/usr/local/arm/2.95./arm-linux/usr/X11R6/include \
--x-libraries=/usr/local/arm/2.95./arm-linux/usr/X11R6/lib \
--disable-video-opengl export PATH=/usr/local/arm/2.95./arm-linux/bin:$PATH make && make install Glib/GTK+
tar -xvzf glib-1.2..tar.gz
cd glib-1.2.
CONFIG_SITE=../ipaq-config.site ./configure \
--prefix=/usr/local/arm/2.95./arm-linux/usr
make
make install
cd ..
tar -xvzf gtk+-1.2..tar.gz
cd gtk+-1.2.
CONFIG_SITE=../ipaq-config.site ./configure \
--prefix=/usr/local/arm/2.95./arm-linux/usr --with-glib=../glib-1.2.
make
make install ffmpeg
tar -xvzf ffmpeg.tar.gz
cd ffmpeg
./configure --cpu=armv4l --cc=arm-linux-gcc --disable-mmx \
--prefix=/usr/local/arm/2.95./arm-linux/usr --enable-shared
cd libavcodec
make Vlc does not require that you install ffmpeg. mad
tar -xvzf mad-0.14.2b.tar.gz
cd mad-0.14.2b
./configure --enable-release --target=arm-linux --host=arm-linux \
--disable-esd \
--prefix=/usr/local/arm/2.95./arm-linux/usr \
--x-includes=/usr/local/arm/2.95./arm-linux/usr/X11R6/include \
--x-libraries=/usr/local/arm/2.95./arm-linux/usr/X11R6/lib \
--disable-video-opengl
export PATH=/usr/local/arm/2.95./arm-linux/bin:$PATH
make gpe
Not described. tremor
Tremor is an integer decoder for the vorbis audio codec. Download the source through CVS at the "xiph.org" website. Log into CVS using the password : anoncvs.
cvs -d :pserver:anoncvs@xiph.org:/usr/local/cvsroot login
cvs -d :pserver:anoncvs@xiph.org:/usr/local/cvsroot co Tremor
cd Tremor
CONFIG_SITE=../ipaq-config.site ./configure \
--prefix=/usr/local/arm/2.95./arm-linux/usr
make ogg
For ogg, it is the same as Tremor.
cvs -d :pserver:anoncvs@xiph.org:/usr/local/cvsroot login
cvs -d :pserver:anoncvs@xiph.org:/usr/local/cvsroot co ogg
cd ogg
CONFIG_SITE=../ipaq-config.site ./configure \
--prefix=/usr/local/arm/2.95./arm-linux/usr
make flac
tar -xvzf flac-1.1..tar.gz
cd flac-1.1.
./configure --enable-release --host=arm-linux --target=arm-linux \
--prefix=/usr/local/arm/2.95./arm-linux/usr It will probably fail (due to the xmms plugin), but it is not a problem, we will continue installation by hand.
cp -Rf include/FLAC /usr/local/arm/2.95./arm-linux/include
cd src/libFLAC
make install libdvbpsi
tar -xvzf libdvbpsi-0.1..tar.gz
cd libdvbpsi-0.1.
./bootstrap
./configure --target=arm-linux --host=arm-linux
make a52
tar -xvzf a52dec-0.7..tar.gz
cd a52dec-0.7.
./configure --enable-release --host=arm-linux --target=arm-linux \
--prefix=/usr/local/arm/2.95./arm-linux/usr
make && make install Cross compiling vlc itself
First of all, run the ./bootstrap script. Then run one of the ipkg/rules.*, according to what you want to compile. Finally you just have to type make and you'll get a stand alone vlc. Run arm-linux-strip to remove symbols and so the size of the file, and now you can test it easily on your PDA. Enjoy ! Written by Marc Ariberti and Jean-Paul Saman, for the VideoLAN Team.

cross compile vlc 播放器的更多相关文章

  1. 使用vlc播放器做rtsp流媒体服务器

    可参考: 使用vlc播放器播放rtsp视频 web网页中使用vlc插件播放相机rtsp流视频 使用vlc进行二次开发做自己的播放器 首先需要安装vlc播放器,下载及安装步骤略 使用vlc播放器做rts ...

  2. 使用vlc播放器播放rtsp流视频

    可参考: 使用vlc播放器做rtsp服务器 web网页中使用vlc插件播放相机rtsp流视频 使用vlc进行二次开发做自己的播放器 首先需要安装vlc播放器,下载及安装步骤略 使用vlc播放器播放rt ...

  3. Android VLC播放器二次开发1——程序结构分析

    最近因为一个新项目需要一个多媒体播放器,所以需要做个视频.音频.图片方面的播放器.也查阅了不少这方面的资料,如果要从头做一个播放器工作量太大了,而且难度也很大.所以最后选择了VLC作为基础,进行二次开 ...

  4. centos7安装VLC播放器

    centos7安装VLC播放器 1.安装eple 下载地址:https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noar ...

  5. Centos 上使用mmsh协议听猫扑网络电台 VLC播放器

    Centos 上使用mmsh协议听猫扑网络电台 VLC播放器 安装CentOS已经有一段时间了,但是由于在Linux下除了学习,其他是事情都干不了.今天想闲来无事开了CentOS就想听一下歌,突然想起 ...

  6. Ubuntu安装VLC播放器

    Ubuntu安装VLC官方介绍:http://www.videolan.org/vlc/download-ubuntu.html sudo apt-get update sudo apt-get in ...

  7. Android VLC播放器二次开发3——音乐播放(歌曲列表+歌词同步滚动)

    今天讲一下对VLC播放器音频播放功能进行二次开发,讲解如何改造音乐播放相关功能.最近一直在忙着优化视频解码部分代码,因为我的视频播放器需要在一台主频比较低的机器上跑(800M主频),所以视频解码能力受 ...

  8. iOS实现基于VLC播放器的封装效果

    前言: 在一些特定场景下,我们获取到的音视频,由于格式比较特殊,用avplayer等播放器是无法播放的,此时,我们可以借助强大的VLC播放器来处理. 原理这里不再赘述,下面我们讲一下如何添加VLC播放 ...

  9. Android VLC播放器二次开发2——CPU类型检查+界面初始化

    上一篇讲了VLC整个程序的模块划分和界面主要使用的技术,今天分析一下VLC程序初始化过程,主要是初始化界面.加载解码库的操作.今天主要分析一下org.videolan.vlc.gui.MainActi ...

随机推荐

  1. 修改elementUI 分页器背景色

    添加background .sysBox .el-pagination.is-background .el-pager li:not(.disabled).active { background-co ...

  2. 9、springcloud整合logback打印sql语句

    Logback是由log4j创始人设计的又一个开源日志组件.logback当前分成三个模块:logback-core.logback- classic和logback-access.logback-c ...

  3. LeetCode Array Easy 217. Contains Duplicate

    Description Given an array of integers, find if the array contains any duplicates. Your function sho ...

  4. python_django_分页

    分页:把从数据库中的数据分为多页在客户端显示. 在django中,可通过这两个对象来实现: Paginator对象 Page对象 Paginator对象与Page对象的关系: paginator对象调 ...

  5. springBoot框架在idea中创建流程 同时存在一个项目中

    1.新建普通maven工程 2.在父级pom中按需修改 3.删除父级src目录 4.创建公共模块common,里面只有service接口和实体类 5.构建微服务模块,provider 6.引用Zook ...

  6. Cesium导出PDF

    首先安装 html2Canvas 和 jspdf npm i html2Canvas - S npm i jspdf - S 然后在vue页面引入 import html2Canvas from 'h ...

  7. Java中IO流之字符流

    我们有了字节流,为什么还需要字符流? 字符的底层是 字节 + 编码表 = 字符,字符是人能看懂的信息. 字符流在使用的时候,会以字节流为基础,把字节写入缓冲区,在缓冲区内根据编码类型(UTF-8,GB ...

  8. MySQL - 两种存储引擎 (MyISAM PK InnoDB) + MVCC

    总结 1.两种存储引擎各有各的有点,MyISAM专注性能,InnoDB专注事务.两者最大的区别就是InnoDB支持事务,和行锁. 2.InnoDB采用MVCC(Multi-Version Concur ...

  9. Minimum Snap轨迹规划详解(1)轨迹规划

    一. 轨迹规划是什么? 在机器人导航过程中,如何控制机器人从A点移动到B点,通常称之为运动规划.运动规划一般又分为两步: 1.路径规划:在地图(栅格地图.四\八叉树.RRT地图等)中搜索一条从A点到B ...

  10. DOM学习总结(六)DOM导航

    什么是 HTML DOM 导航? DOM是一个以节点关系组成的结构,所以我们可以使用节点之间的关联找到整个HTML页面中的元素 1.HTML DOM 节点列表: getElementsByTagNam ...