本文主要是介绍LIVE555学习1:Linux下live555的编译及测试,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
以下为在linux下编译和测试live555的全部过程。
文章目录
- 1 源码下载
- 2 编译
- 3 测试
1 源码下载
官网地址:http://www.live555.com/liveMedia/public/
打开后,选择live555-latest.tar.gz
2 编译
在主目录下创建文件config.3516c,内容如下:
CROSS_COMPILE?=
COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -DNO_SSTREAM=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DALLOW_SERVER_PORT_REUSE
C = c
C_COMPILER = $(CROSS_COMPILE)gcc
C_FLAGS = $(COMPILE_OPTS)
CPP = cpp
CPLUSPLUS_COMPILER = $(CROSS_COMPILE)g++
CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 -DLOCALE_NOT_USED
OBJ = o
LINK = $(CROSS_COMPILE)g++ -o
LINK_OPTS =
CONSOLE_LINK_OPTS = $(LINK_OPTS)
LIBRARY_LINK = $(CROSS_COMPILE)ar cr
LIBRARY_LINK_OPTS = $(LINK_OPTS)
LIB_SUFFIX = a
LIBS_FOR_CONSOLE_APPLICATION =
LIBS_FOR_GUI_APPLICATION =
EXE =
注意,如果是要在嵌入式设备上使用,则需要修改编译链,如下:
CROSS_COMPILE?= arm-hisiv500-linux-
运行如下命令:
#./genMakefiles 3516c
#make
3 测试
进入mediaServe目录,运行程序live555MediaServer
root@virtual:# ./live555MediaServer LIVE555 Media Serverversion 0.91 (LIVE555 Streaming Media library version 2018.04.25).
Play streams from this server using the URLrtsp://192.168.1.100/<filename>
where <filename> is a file present in the current directory.
Each file's type is inferred from its name suffix:".264" => a H.264 Video Elementary Stream file".265" => a H.265 Video Elementary Stream file".aac" => an AAC Audio (ADTS format) file".ac3" => an AC-3 Audio file".amr" => an AMR Audio file".dv" => a DV Video file".m4e" => a MPEG-4 Video Elementary Stream file".mkv" => a Matroska audio+video+(optional)subtitles file".mp3" => a MPEG-1 or 2 Audio file".mpg" => a MPEG-1 or 2 Program Stream (audio+video) file".ogg" or ".ogv" or ".opus" => an Ogg audio and/or video file".ts" => a MPEG Transport Stream file(a ".tsx" index file - if present - provides server 'trick play' support)".vob" => a VOB (MPEG-2 video with AC-3 audio) file".wav" => a WAV Audio file".webm" => a WebM audio(Vorbis)+video(VP8) file
See http://www.live555.com/mediaServer/ for additional documentation.
(We use port 80 for optional RTSP-over-HTTP tunneling, or for HTTP live streaming (for indexed Transport Stream files only).)
运行之后,可以看到上面的打印信息,上面显示了支持的格式,如H264/H265/TS等,我们将一个测试视频Titanic.ts放入到当前目录下,在VLC中输入:rtsp://192.168.1.100/Titanic.ts 既可以看到VLC正常播放此视频。
这篇关于LIVE555学习1:Linux下live555的编译及测试的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!