【FFMPEG】NI Real time linux上安装ffmpeg

由于需要在NI平台上使用ffmpeg库,以实现网络媒体流。安装过程与正常安装有些许区别,记录如下:

一、 安装环境

1. 硬件平台 NI-IC-373

2. ffmpeg 版本 ffmpeg-3.3.4

二、 安装过程

1. 下载ffmpeg源码,可通过git仓库下载

git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg


2.  安装辅助产品,本人安装了以下产品,不一定都需要,只是我一步步安装测试的时候安装的

opkg install yasm

opkg install xz

opkg install autoconf automake bzip2 cmake gcc libtool make pkgconfig

opkg install binutils-symlinks

opkg install gcc-dev

opkg install coreutils


参考

/configure会报错:pr command not found

Compile FFmpeg on Ubuntu, Debian, or Mint


3. 然后修改 configure 文件,由于pkg-config 不需要交叉编译前缀

Fall-back on a native system pkg-config if a cross-prefixed pkg-config is not found.

---

configure |    9 +++++++--

1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure b/configure

index f30998b..9ea6341 100755

--- a/configure

+++ b/configure

@@ -2130,8 +2130,13 @@ enabled cross_compile || host_cc_default=$cc

set_default host_cc

if ! $pkg_config --version >/dev/null 2>&1; then

-    warn "$pkg_config not found, library detection may fail."

-    pkg_config=false

+    if pkg-config --version >/dev/null 2>&1; then

+        warn "$pkg_config not found, using $(which pkg-config)."

+        pkg_config=pkg-config

+    else

+        warn "$pkg_config not found, library detection may fail."

+        pkg_config=false

+    fi

fi

exesuf() {

--

1.7.2.5

参考:[FFmpeg-devel] [PATCH] Fix pkg-config detection when using a cross-prefix

4. 安装

./configure --cross-prefix=x86_64-nilrt-linux- --enable-cross-compile --target-os=linux --cc=x86_64-nilrt-linux-gcc --arch=amd64 --enable-shared --disable-static --prefix=/opt/ffmpeg

make -j4

make install -j4


注:如果需要安装libx264支持,请参考

http://blog.csdn.net/li_wen01/article/details/62889494

http://www.cnblogs.com/gjianw217/p/3228455.html

./configure --enable-nonfree --enable-shared --enable-nvenc --enable-cuda --enable-cuvid --prefix=/opt/ffmpeg --enable-libx264 --enable-gpl


5. 环境配置

环境变量

#vi /etc/profile

//// 添加

PATH=$PATH:/opt/ffmpeg/bin

引用库目录

# vi /etc/ld.so.conf

//// 添加

/opt/ffmpeg/lib

# ldconfig


参考: 多线程的make

其他参考

1. FFmpeg在Linux下编译使用

2. ffmpeg 在linux下编译

3. FFmpeg在Linux下安装编译过程

4. Linux-安装FFmpeg

其他问题

1. Ffmpeg error in linux [closed]

2. https://linuxserverguide.wordpress.com/2010/10/15/ffmpeg-error-while-loading-shared-libraries-libavdevice-so-52-cannot-open-shared-object-file/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容