Compile libRTMP with MinGW

转自:

http://go.kblog.us/2012/09/compile-librmtp-with-mingw.html

The libRTMP library provides online multimedia streaming support for many open-source projects, such as ffmpeg and curl. I am building librtmp for use with ffmpeg and mplayer. I downloaded the latest release tarball from here.

  1. First, I compiled zlib as shown in this post.

    make -f win32/Makefile.gcc
    cp -iv zlib1.dll /mingw/bin
    cp -iv zconf.h zlib.h /mingw/include
    cp -iv libz.a /mingw/lib
    cp -iv libz.dll.a /mingw/lib
  2. Then, I built OpenSSL as shown in this post.

    ./Configure -DHAVE_STRUCT_TIMESPEC -L/mingw/lib -lz -lpthreadGC2 -lws2_32 --prefix=/mingw threads zlib mingw
    make
    make install
  3. Then, I built librtmp.

    make SYS=mingw
    cp -iv *.exe /mingw/bin

    To build the shared library, I typed:

    cd librtmp
    gcc -shared -o librtmp.dll -Wl,--out-implib,librtmp.dll.a rtmp.o log.o amf.o hashswf.o parseurl.o -lssl -lcrypto -lz -lws2_32 -lwinmm -lgdi32

    To install librtmp, I typed the following:

    cp -iv librtmp.dll /mingw/bin
    cp -iv amf.h http.h log.h rtmp.h /mingw/include/librtmp
    cp -iv librtmp*.a /mingw/lib
    cp -iv librtmp.pc /mingw/lib/pkgconfig
  4. Sometimes, librtmp.pc fails to be generated. In that case, make it yourself and copy it to /mingw/lib/pkgconfig.

    prefix=/mingw
    exec_prefix=${prefix}
    libdir=${exec_prefix}/lib
    incdir=${prefix}/include/librtmp
    
    Name: librtmp
    Description: RTMP implementation
    Version: 2.3
    Requires: openssl libcrypto
    URL: http://rtmpdump.mplayerhq.hu
    Libs: -L${libdir} -lrtmp -lz
    Libs.private: -lws2_32 -lwinmm -lgdi32 -lssl -lcrypto
    Cflags: -I${incdir}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值