Live555: RtspServer 示例

概述

live555官方地址:http://www.live555.com/liveMedia/public/。该地址下有live555的工程包(比如:live.2019.10.20.tar.gz),以及h264/h265的测试流文件。本文以live.2019.10.20.tar.gz为例,介绍live555 rtspserver示例代码。

live555工程的目录结构如下所示,其中testProgs则为测试用例,本文将以OnDemandServerMediaSubsession.cpp为例,解说示例如何运行,以及代码结构。

├── BasicUsageEnvironment
│   └── include
├── groupsock
│   └── include
├── liveMedia
│   └── include
├── mediaServer
├── proxyServer
├── testProgs
├── UsageEnvironment
│   └── include
└── WindowsAudioInputDevice

运行示例

1、编译live555工程,确认testProgs中的源文件被编译。
2、执行OnDemandServerMediaSubsession,在执行该程序的目录下必须存在test.h264的码流文件。比如笔者在userdata目录下存在test.h264,则可直接在userdata目录下运行OnDemandServerMediaSubsession。完整的步骤和log如下所示:

[root@rk3328:/userdata]# ls test.264 -al
-rwxrwxrwx 1 root root 87402 Oct 17 06:56 test.264
[root@rk3328:/userdata]# 
[root@rk3328:/userdata]# /usr/bin/testOnDemandRTSPServer

"mpeg4ESVideoTest" stream, from the file "test.m4e"
Play this stream using the URL "rtsp://xxx.xxx.xxx.xxx:8554/mpeg4ESVideoTest"

"h264ESVideoTest" stream, from the file "test.264"
Play this stream using the URL "rtsp://xxx.xxx.xxx.xxx:8554/h264ESVideoTest"

"h265ESVideoTest" stream, from the file "test.265"
Play this stream using the URL "rtsp://xxx.xxx.xxx.xxx:8554/h265ESVideoTest"

"mpeg1or2AudioVideoTest" stream, from the file "test.mpg"
Play this stream using the URL "rtsp://xxx.xxx.xxx.xxx:8554/mpeg1or2AudioVideoTest"

"mpeg1or2ESVideoTest" stream, from the file "testv.mpg"
Play this stream using the URL "rtsp://xxx.xxx.xxx.xxx:8554/mpeg1or2ESVideoTest"

"mp3AudioTest" stream, from the file "test.mp3"
Play this stream using the URL "rtsp://xxx.xxx.xxx.xxx:8554/mp3AudioTest"

"wavAudioTest" stream, from the file "test.wav"
Play this stream using the URL "rtsp://xxx.xxx.xxx.xxx:8554/wavAudioTest"

"amrAudioTest" stream, from the file "test.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值