文档章节

openRTSP document

codec-avs
 codec-avs
发布于 2016/05/02 19:45
字数 1366
阅读 112
收藏 0

Playing-time options

You can change this duration using the "-d <duration>" option. If <duration> is positive, it is the total number of seconds of the stream to be played before closing down the session and exiting. If <duration> is negative, then -<duration> gives the number of extra seconds to delay after the time specified in the SDP "a=range" attribute. (As noted above, the default value for this extra time is 5 seconds.)

可以使用"-d <duration>" 选项,如果<duration>被设置为>0,程序将播放<duration>时长的数据流,单位为秒。如果设置为<0,那么程序将在流结束后延时<duration>,然后结束播放,其中流的播放时长有SDP参数"a=range"所指定。(如果是延时结束,-d的默认时长是5秒)

For example, if the SDP description contains "a=range:npt=0-25", then "-d 10" means "play the stream(s) for 10 seconds, then exit", and "-d -10" means "play the stream(s) for 35 seconds, then exit".

例如,对于SDP描述"a=range:npt=0-25",参数"-d 10"的意思是"播放10秒钟时长的流,然后退出","-d -10"的意思是"播放35(25+10)秒,然后退出"。

You can also use the "-D <maximum-inter-packet-gap>" option to ask that the program shut down if no new incoming RTP (i.e., data) packets are received within a period of at least<maximum-inter-packet-gap> seconds. This option is useful if you are running the program automatically (e.g., from within a script), and wish to allow for the possibility of servers that die unexpectedly. (Note that "-d" and "-D" are different options, and may both be used.)

使用"-D <maximum-inter-packet-gap>"参数,程序在<maximum-inter-packet-gap> 时间内如果没有接收到RTP包,将自动退出。对于无人值守的程序比如自动执行的脚本,如果服务器意外宕机的,这样的参数将使程序不会挂死。

You can also use the "-c" option to play the media sessions continuously. I.e., after the end time has elapsed, the program starts all over again, by issuing another set of "PLAY" requests. (Note that if you're receiving data (i.e., you don't use the "-r" option), then this means you'll get multiple copies of the data in the output file(s).)

循环播放可以使用"-c"参数,在一轮播放完毕后,程序通过发起一组新的播放请求,重头开始播放。

Note that you can combine "-c" with "-d <duration>" and/or "-D <maximum-inter-packet-gap>". So, for example, "-c -d 10" means "play the stream(s) for 10 seconds, then go back and play them again for another 10 seconds, etc., etc."

"-c","-d <duration>"以及"-D <maximum-inter-packet-gap>"可以合并使用。例如 "-c -d 10"的意思是播放10秒,然后重头开始再播放10秒。


Receiving unsupported RTP payload formats

Note: An "RTP payload format" for a codec is a set of rules that define how the codec's media frames are packed within RTP packets. This is usually defined by an IETF RFC (or, for newer payload formats, an IETF Internet-Draft).

编码中的"RTP payload format"定义如何打包音视频帧。

By default, the program will ignore any subsession whose RTP payload format it doesn't understand (because, if it doesn't know the RTP payload format, it doesn't know how to extract data from the incoming RTP stream).

在默认情况下,如果程序不认识RTP载荷格式,后续帧将被丢弃。(因为,如果程序不认识载荷的格式,那么它就不知道如何从RTP流中获取音视频数据)

However, if an input stream uses a RTP payload format that the program does not support, then you may still be able to receive this data, by using the "-S <byte-offset>" option. This option tells the program to assume that any such unsupported stream uses a very 'simple' RTP payload format, in which the stream's data is packed contiguously into RTP packets, following the RTP header. (In particular, the payload format must not use interleaving.) <byte-offset> specifies the size (in bytes) of any special header that follows the standard RTP header. (This special header is skipped over, and is not interpreted at all.)

但是,即使不认识RTP的载荷格式,程序还是有可能接受数据,通过使用"-S <byte-offset>"参数。这个参数告诉程序,对于不认识载荷的RTP包,程序将流理解为一种简单的载荷格式,即流将音视频数据连续打包,并且紧跟在RTP头之后。(In particular, the payload format must not use interleaving.)<byte-offset>是紧跟着标准RTP头的数据长度。程序将跳过这一长度,不做任何操作)

For example, if the program didn't already handle PCM u-law audio ("audio/PCMU"; RTP payload format code 0), then you could receive it using the option "-S 0". If the program didn't already handle MPEG audio ("audio/MPEG"; RTP payload format code 14), then you could receive it using the option "-S 4" (because the RTP payload format for MPEG audio, defined in RFC 2250, specifies a (basically useless) 4-byte header at the start of the RTP payload).

例如,如果程序不能够处理PCM u-law audio ("audio/PCMU"; RTP payload format code 0),如果你知道是这个编码,那么通过加入"-S 0",程序将以一种连续的方式提取音视频数据。如果是MPEG audio("audio/MPEG"; RTP payload format code 14),那么使用"-S 4",因为RFC2250中定义的MPEG为音频编码格式指定了4-byte头。



Changing the output file buffer size

If you see an error message "The total received frame size exceeds the client's buffer size", then this indicates that incoming RTP data formed a frame that was too large for this program's output file buffer. By default, a 100 kByte buffer is used, so this situation usually does not occur. (It occurs only for codecs - such as JPEG - that can have very large frames.)

如果你看见像"完整帧大小超过客户端缓冲"这样的错误信息,意思是RTP帧的大小超过了程序向文件输出数据的缓冲大小。程序默认使用100KB大小的缓冲,通常是足够的。但是对于像JPEG这样的有着非常大帧的编码格式而言,会出现这样的错误消息。

If, however, you see this error message, you can increase the output file buffer size using the "-b <buffer-size>" option.

如果你看见这样的错误信息,你可以通过"-b <buffer-size>"参数来增加程序缓冲大小,多少?只能自己测试了。




© 著作权归作者所有

codec-avs
粉丝 3
博文 6
码字总数 5143
作品 0
南京
程序员
私信 提问
让android支持RTSP及live555分析

#DATE 2012/05/09 #2012/08/27由cnblogs迁入 如何让Android支持C++异常机制 Android不支持C++异常机制,如果需要用到的话,则需要在编译的时候加入比较完整的C++库. Android支持的C++库可以在A...

Wii-D
2012/08/27
5.6K
6
RTSP 客户端软件--openRTSP

openRTSP 是一个命令行 RTSP 客户端软件,运行.exe时需要一个命令行参数(比如rtsp://192.168.30.61/video1),然后就会根据这个获取需要的码流, 图如下: 通过quit命令可以结束程序的执行。...

shawn chen
2010/11/14
11.6K
2
RTSP学习笔记(5)openRTSP流程分析

openRTSP是对RTSPClient的实现,与服务器对应的客户端功能 1、初始化 BasicTaskschedular::createNew() BasicUsageEnvironment::createNew() 解析输入streamURL ourClient= createClient(str......

Sean-x
2016/02/24
210
0
关于EasyRTSPClient、EasyPlayer RTSP流重连问题的解释

EasyPlayer、EasyRTSPClient是如何设计重连的 首先大概解释一下EasyRTSPClient与EasyPlayer间的关系:EasyRTSPClient是一个专门用于与RTSP流媒体服务器交互的RTSPClient框架,类似于live555...

xiejiashu
2017/12/09
0
0
MongoDB查询字符串类型数字 最值

先找字符串长度最长的,再按降序排列,取第一个 /** * 查询数据 最大值(字符串型) * fieldname 要查询的字段名 */ public String findMaxString(String fieldname){ int i = 6; Document do...

霜叶情
2018/05/24
169
0

没有更多内容

加载失败,请刷新页面

加载更多

【在 Nervos CKB 上做开发】Nervos CKB 脚本编程简介[3]:自定义代币

原文作者:Xuejie 原文链接:https://xuejie.space/2019_09_06_introduction_to_ckb_script_programming_udt/ Nervos CKB 脚本编程简介[3]:自定义代币 CKB 的 Cell 模型和 VM 支持许多新的用...

NervosCommunity
51分钟前
4
0
通过OAuth2.0 获取授权访问SF 用户数据

通过OAuth2.0 获取授权访问SF 用户数据 OAuth2.0 相关知识 深入了解 Salesforce 中的 OAuth 2.0(SF官方) OAuth 2.0 的一个简单解释(阮一峰大神) OAuth 2.0 的四种方式(阮一峰大神) GitHub OA...

在山的那边
57分钟前
7
0
编写程序:从键盘上接受一个三位数(首先要确保是三位数),计算出各位之和输出。

#include<stdio.h> int main() { int a,sum=0; printf("请输入一个三位数:\n"); scanf("%d",&a); sum=a/100+a%100/10+a%10; printf("这三个数的和:%d",sum); return 0; }......

201905021729吴建森
今天
7
0
如何离开/退出/停用Python virtualenv

我正在使用virtualenv和virtualenvwrapper。 我可以使用workon命令在virtualenv之间切换。 me@mymachine:~$ workon env1(env1)me@mymachine:~$ workon env2(env2)me@mymachine:~$ workon e......

技术盛宴
今天
7
0
成长之路 万事坚持难

任何事情开了头,想要更好的发展下去,不忘初心,就一定要坚持下去。 以前自己坚持了一些事情,比如早睡不吃东西,由于中途断了,没有及时止损,导致又接着恶习断了几天。所以 及时的反省和调...

T型人才追梦者
今天
7
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部