LIVE555再学习 -- Linux 下编译

现在我们来看一下 LIVE555 在Linux下的编译


一、下载源码

下载:Index of /liveMedia/public

参看:LIVE555 Streaming Media


选择下载 live555-latest.tar.gz

二、文件介绍

我的开发环境为 Ubuntu 12.04
将上面下载的 live555-latest.tar.gz 解压
tar -zxvf live555-latest.tar.gz


包括上述四个库和mediaServer服务器程序,以及其他的测试代码。
这几个文件在官网是有介绍的:

三、配置编译


The source code package can be found (as a ".tar.gz" file) here. Use "tar -x" and "gunzip" (or "tar -xz", if available) to extract the package; then cd to the "live" directory. Then run
    ./genMakefiles <os-platform>
where  <os-platform>  is your target platform - e.g., "linux" or "solaris" - defined by a "config. <os-platform> " file. This will generate a Makefile in the "live" directory and each subdirectory. Then run "make".
  • If the "make" fails, you may need to make small modifications to the appropriate "config.<os-platform>" file, and then re-run "genMakefiles <os-platform>". (E.g., you may need to add another "-I<dir>" flag to the COMPILE_OPTS definition.)
  • Some people (in particular, FreeBSD users) have reported that the GNU version of "make" - often called "gmake" - works better than their default, pre-installed version of "make". (In particular, you should try using "gmake" if you encounter linking problems with the "ar" command.)
  • If you're using "gcc" version 3.0 or greater: You may also wish to add the -Wno-deprecated flag to CPLUSPLUS_FLAGS.
  • If no "config.<os-platform>" file exists for your target platform, then try using one of the existing files as a template.
If you wish, you can also 'install' the headers, libraries, and applications by running "make install".

翻译一下:
解压  live555-latest.tar.gz 
tar -zxvf live555-latest.tar.gz
进入 live 目录
cd live
然后执行
./genMakefiles <os-platform>
其中<os-platform>是您的目标平台,例如由“config.<os-platform>”文件定义的“linux”或“solaris”。
因此可知,应执行 ./genMakefiles linux

这将在“live”目录和每个子目录中生成一个Makefile。
然后运行“make”
如果“make”失败,您可能需要对相应的“config.<os-platform>”文件进行小修改,然后重新行“
genMakefiles <os-platform>”。 (例如,您可能需要在COMPILE_OPTS定义中添加另一个“-I <dir>”标志。)
有些人(特别是FreeBSD用户)已经报告说,“make”的GNU版本(通常称为“gmake”)比默认的预装版本“make”更好。 (特别是,如果遇到与“ar”命令的连接问题,您应该尝试使用“gmake”。)
如果您使用的是“gcc”3.0或更高版本:您也可以将-Wno-deprecated标志添加到CPLUSPLUS_FLAGS。
如果您的目标平台没有“config.<os-platform>”文件,请尝试使用其中一个现有文件作为模板。
如果您愿意,还可以通过运行“make install”来安装头文件,库和应用程序。

然后可以看到 mediaServer 目录下生成文件 live555MediaServer


四、测试

执行 live555MediaServer


然后找一个视频文件,放在和 live555MediaServer同一目录。注意视频格式,要是上面所支持的。
然后打开 VLC,媒体->打开网络串流,输入网络URL。 rtsp://电脑IP地址/<filename>


五、源码下载



  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
在 Android 平台上编译 Live555 需要进行以下几个步骤: 1. 下载 Live555 的源码 可以从 Live555 的官网下载源码包,也可以从 GitHub 上下载。 2. 配置交叉编译环境 由于 Live555 是一个 C++ 库,需要使用交叉编译工具链进行编译。你需要下载并安装 Android NDK,并设置好环境变量。 3. 修改 Live555 的配置文件 进入 Live555 的源码目录,找到 `config.Android` 文件,将其中的变量设置为 Android 平台的交叉编译工具链路径和库路径。例如: ``` ANDROID_NDK=/path/to/android-ndk ANDROID_SDK=/path/to/android-sdk ANDROID_API=android-21 ANDROID_ARCH=arch-arm ANDROID_TOOLCHAIN=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 ANDROID_LIB=$ANDROID_NDK/platforms/$ANDROID_API/$ANDROID_ARCH/usr/lib ``` 4. 编译 Live555 库 在命令行中执行以下命令进行编译: ``` ./genMakefiles android make ``` 编译完成后,会生成一个 `live` 目录,其中包含了编译好的库文件和头文件。 5. 将 Live555 库集成到 Android 项目中 将 `live` 目录下的库文件和头文件拷贝到 Android 项目的 jni 目录下,并在 Android.mk 文件中添加以下内容: ``` LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := live555 LOCAL_SRC_FILES := libliveMedia.a libBasicUsageEnvironment.a libgroupsock.a libUsageEnvironment.a LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include include $(PREBUILT_STATIC_LIBRARY) ``` 其中,`LOCAL_SRC_FILES` 指定编译好的库文件,`LOCAL_EXPORT_C_INCLUDES` 指定头文件路径。然后在需要使用 Live555 的代码中引用 `live555` 模块即可。 以上就是在 Android 平台上编译 Live555 的基本步骤。由于 Live555 的配置比较复杂,如果遇到问题可以参考 Live555 的官方文档或者在社区中寻求帮助。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

聚优致成

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值