Amend RTSP dev guide to match the current code status.
PiperOrigin-RevId: 381852972
This commit is contained in:
parent
ffbec2234d
commit
02db70bdd0
@ -2,10 +2,13 @@ ExoPlayer supports both live and on demand RTSP. Supported formats and network
|
|||||||
types are listed below.
|
types are listed below.
|
||||||
|
|
||||||
**Supported formats**
|
**Supported formats**
|
||||||
* H264
|
* H264. The SDP media description must include SPS/PPS data in the fmtp
|
||||||
* AAC (with ADTS bitstream)
|
attribute for decoder initialization.
|
||||||
* AC3
|
* AAC (with ADTS bitstream).
|
||||||
|
* AC3.
|
||||||
|
|
||||||
**Supported network types**
|
**Supported network types**
|
||||||
* RTP over UDP unicast (multicast is not supported)
|
* RTP over UDP unicast (multicast is not supported).
|
||||||
* Interleaved RTSP, RTP over RTSP using TCP
|
* Interleaved RTSP, RTP over RTSP using TCP.
|
||||||
|
|
||||||
|
> Playback of RTP streams is not supported.
|
||||||
|
25
docs/rtsp.md
25
docs/rtsp.md
@ -26,6 +26,13 @@ player.prepare();
|
|||||||
{: .language-java}
|
{: .language-java}
|
||||||
|
|
||||||
|
|
||||||
|
### Play authentication-enabled RTSP content ###
|
||||||
|
|
||||||
|
ExoPlayer supports playback with RTSP BASIC and DIGEST authentication. To play
|
||||||
|
protected RTSP content, the `MediaItem`'s URI must be configured with the
|
||||||
|
authtication info. Specifically, the URI should follow the format
|
||||||
|
`rtsp://<username>:<password>@<host address>`.
|
||||||
|
|
||||||
## Using RtspMediaSource ##
|
## Using RtspMediaSource ##
|
||||||
|
|
||||||
For more customization options, you can create an `RtspMediaSource` and pass it
|
For more customization options, you can create an `RtspMediaSource` and pass it
|
||||||
@ -45,7 +52,7 @@ player.prepare();
|
|||||||
~~~
|
~~~
|
||||||
{: .language-java}
|
{: .language-java}
|
||||||
|
|
||||||
## Using RTSP behind a NAT ##
|
## Using RTSP behind a NAT (RTP/TCP support) ##
|
||||||
|
|
||||||
ExoPlayer uses UDP as the default protocol for RTP transport.
|
ExoPlayer uses UDP as the default protocol for RTP transport.
|
||||||
|
|
||||||
@ -55,3 +62,19 @@ necessary UDP port mapping. If ExoPlayer detects there have not been incoming
|
|||||||
RTP packets for a while and the playback has not started yet, ExoPlayer tears
|
RTP packets for a while and the playback has not started yet, ExoPlayer tears
|
||||||
down the current RTSP playback session, and retries playback using RTP-over-RTSP
|
down the current RTSP playback session, and retries playback using RTP-over-RTSP
|
||||||
(transmitting RTP packets using the TCP connection opened for RTSP).
|
(transmitting RTP packets using the TCP connection opened for RTSP).
|
||||||
|
|
||||||
|
The timeout for retrying with TCP can be customized by calling the method
|
||||||
|
`RtspMediaSource.Factory.setTimeoutMs()`. For example, if the timeout is set to
|
||||||
|
four seconds, the player will retry with TCP after four seconds of UDP
|
||||||
|
inactivity.
|
||||||
|
|
||||||
|
> Setting the timeout also affects the end-of-stream detection logic. That is,
|
||||||
|
ExoPlayer will report the playback has ended if nothing is received for the
|
||||||
|
duration of the set timeout. Setting this value too small may lead to pre-mature
|
||||||
|
stream ending under poor network conditions.
|
||||||
|
|
||||||
|
### Force using RTP/TCP ###
|
||||||
|
ExoPlayer can also be configured to play with RTP/TCP by default. To do so,
|
||||||
|
use method `RtspMediaSource.Factory.setForceUseRtpTcp()`.
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user