[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTSP session timeout and keepalive #662

Closed
1 task
0xb0ba opened this issue Sep 19, 2023 · 1 comment
Closed
1 task

RTSP session timeout and keepalive #662

0xb0ba opened this issue Sep 19, 2023 · 1 comment
Assignees

Comments

@0xb0ba
Copy link
0xb0ba commented Sep 19, 2023

Version

Media3 1.1.1

More version details

No response

Devices that reproduce the issue

tested on several emulators (Android Studio Emulator, MUMU12) and Redmi Note 8T

RTSP source: 70MAI Dash Cam A800S

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

according to rfc2326, the second parameter in "Session" in the response header is a timeout:

Session = "Session" ":" session-id [ ";" "timeout" "=" delta-seconds ]

The timeout parameter is only allowed in a response header. The
server uses it to indicate to the client how long the server is
prepared to wait between RTSP commands before closing the session due
to lack of activity (see Section A). The timeout is measured in
seconds, with a default of 60 seconds (1 minute).

it is this timeout that must be used when creating androidx.media3.exoplayer.rtsp.RtspClient.KeepAliveMonitor instead of androidx.media3.exoplayer.rtsp.RtspClient.DEFAULT_RTSP_KEEP_ALIVE_INTERVAL_MS = 30_000.
this will allow to use servers that have a session timeout of less than 30 seconds, such as DVRs.

Expected result

video plays for a long time

Actual result

playback stops after 3 seconds

Media

video stream from 70MAI Dash Cam A800S

SETUP rtsp://192.168.10.1/liveRTSP/av4/track1 RTSP/1.0
User-Agent: ExoPlayerLib/2.19.1
CSeq: 2
Transport: RTP/AVP;unicast;client_port=53426-53427

RTSP/1.0 200 OK
CSeq: 2
Date: Tue, Sep 19 2023 18:36:32 GMT
Transport: RTP/AVP;unicast;destination=192.168.10.10;source=192.168.10.1;client_port=53426-53427;server_port=6970-6971
Session: 60D9C7BC;timeout=3

Bug Report

copybara-service bot pushed a commit that referenced this issue Oct 5, 2023
Set KeepAliveMonitor to send a keep-alive message at half the timeout value, if provided, by the RTSP Setup response.

Issue: #662
PiperOrigin-RevId: 570946237
copybara-service bot pushed a commit to google/ExoPlayer that referenced this issue Oct 5, 2023
Set KeepAliveMonitor to send a keep-alive message at half the timeout value, if provided, by the RTSP Setup response.

Issue: androidx/media#662
PiperOrigin-RevId: 570946237
@microkatz
Copy link
Contributor

Hi @0xb0ba,

I submitted a commit, 42c1846, to the androidx/media main branch. It makes the RtspClient utilize the timeout value provided in the SETUP response. Hopefully that will address your issue! Please re-open or create a new issue if it did not. Thanks for reporting your problem!

oceanjules pushed a commit that referenced this issue Oct 9, 2023
Set KeepAliveMonitor to send a keep-alive message at half the timeout value, if provided, by the RTSP Setup response.

Issue: #662
PiperOrigin-RevId: 570946237
(cherry picked from commit 42c1846)
@androidx androidx locked and limited conversation to collaborators Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants