一半君的总结纸

听话只听一半君

CentOS 7 用自动 build script (static?) compile 带 librtmp 的 FFmpeg

因为要在cxxFuck项目里用到FFmpeg,而yum搜了一下又没有(难道CentOS 7太新?),我把旧笔记本刚升级到了7.本贴内容有更新 更新ffmpeg到2.8.3 static compile, 带x265 rtmp x11grab(录屏幕用)

首先官方指南是有CentosCompilationGuide – FFmpeg,但是有好多步,所以我用了高手的一个自动build script(我给fork了一下,加了几行关于librtmp的,在这里

我的步骤是

  1. 先装了官网提到的依赖
    yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
    yum install glibc-static
    
  2. 然后用自动build script装
    git clone https://github.com/oglops/ffmpeg-static.git
    cd ffmpeg-static
    ./build.sh
    

  3. 碰到个问题 ERROR: librtmp not found ,还没有解决
    edit: 后来在build script里加入了openssl也给先build一个的部分,最后

    > ldd target/bin/ffmpeg
            not a dynamic executable
    
    > target/bin/ffmpeg -protocols | grep rtmp
    ...
    rtmp
    rtmpe
    rtmps
    rtmpt
    rtmpte
    ...
    

Tips备忘录:

  1. 看一个library是不是装了 比如libssl
    gcc -lssl
    # 或者
    ldconfig -p | grep libssl
    # 还可以
    whereis libssl
    # 都比locate好用些
    
  2. output all linker flags
    pkg-config --libs librtmp
    
Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: