androidx / androidx/media

IOException: SDP format error , Caused by: androidx.media3.common.ParserException: clock

Open
#2,322 2 comments 0 reactions 1 assignee View on GitHub

@microkatz is already working on this.

Since Apr 9, 2025.

enhancement
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 main branch

More version details

I am encountering an issue when trying to playback an RTSP URL with the following SDP:

v=0
o=- 1109162014219182 0 IN IP4 0.0.0.0
s=HIK Media Server V4.72.107
i=HIK Media Server Session Description : standard
e=NONE
c=IN IP4 0.0.0.0
t=0 0
a=control:*
b=AS:4106
a=range:clock=20250319T200000Z-20250319T210000Z
m=video 0 RTP/AVP 96
i=Video Media
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=4D0014;packetization-mode=0
a=control:trackID=video
b=AS:4096
m=audio 0 RTP/AVP 0
i=Audio Media
a=rtpmap:0 PCMU/8000
a=control:trackID=audio
b=AS:10
a=Media_header:MEDIAINFO=494D4B48020100000400000110710110401F000000FA000081000000000000000000000000000000;
a=appversion:1.0

I noticed that the a=range:clock=20250319T200000Z-20250319T210000Z results in a ParserException in Media3. Is there a way for me to fix this?
I searched on the issue page, but I couldn't find any issues related to the problem I'm facing.

Devices that reproduce the issue

Samsung A50s

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

RTSP/1.0 200 OK
CSeq: 2
Content-Type: application/sdp
Content-Length: 602
Date: Wed, 09 Apr 2025 11:54:44 GMT

                                                                                                v=0
                                                                                                o=- 1109162014219182 0 IN IP4 0.0.0.0
                                                                                                s=HIK Media Server V4.72.107
                                                                                                i=HIK Media Server Session Description : standard
                                                                                                e=NONE
                                                                                                c=IN IP4 0.0.0.0
                                                                                                t=0 0
                                                                                                a=control:*
                                                                                                b=AS:4106
                                                                                                a=range:clock=20250319T200000Z-20250319T210000Z
                                                                                                m=video 0 RTP/AVP 96
                                                                                                i=Video Media
                                                                                                a=rtpmap:96 H264/90000
                                                                                                a=fmtp:96 profile-level-id=4D0014;packetization-mode=0
                                                                                                a=control:trackID=video
                                                                                                b=AS:4096
                                                                                                m=audio 0 RTP/AVP 0
                                                                                                i=Audio Media
                                                                                                a=rtpmap:0 PCMU/8000
                                                                                                a=control:trackID=audio
                                                                                                b=AS:10
                                                                                                a=Media_header:MEDIAINFO=494D4B48020100000400000110710110401F000000FA000081000000000000000000000000000000;
                                                                                                a=appversion:1.0

2025-04-09 18:54:43.535 27444-31982 ExoPlayerImplInternal com.test.myapplication E Playback error (Ask Gemini)
androidx.media3.exoplayer.ExoPlaybackException: Source error
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:865)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:841)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:246)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.io.IOException: SDP format error.
at androidx.media3.exoplayer.rtsp.RtspMediaPeriod$InternalListener.onSessionTimelineRequestFailed(RtspMediaPeriod.java:697)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.onDescribeResponseReceived(RtspClient.java:727)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspResponse(RtspClient.java:638)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspMessage(RtspClient.java:531)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.lambda$onRtspMessageReceived$0$androidx-media3-exoplayer-rtsp-RtspClient$MessageListener(RtspClient.java:524)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246) 
at android.os.HandlerThread.run(HandlerThread.java:67) 
Caused by: androidx.media3.common.ParserException: clock=20250319T200000Z-20250319T210000Z {contentIsMalformed=true, dataType=4}
at androidx.media3.exoplayer.rtsp.RtspMessageUtil.checkManifestExpression(RtspMessageUtil.java:477)
at androidx.media3.exoplayer.rtsp.RtspSessionTiming.parseTiming(RtspSessionTiming.java:51)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.onDescribeResponseReceived(RtspClient.java:725)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspResponse(RtspClient.java:638) 
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspMessage(RtspClient.java:531) 
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.lambda$onRtspMessageReceived$0$androidx-media3-exoplayer-rtsp-RtspClient$MessageListener(RtspClient.java:524) 
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0) 
at android.os.Handler.handleCallback(Handler.java:938) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:246) 
at android.os.HandlerThread.run(HandlerThread.java:67) 
2025-04-09 18:54:44.020 27444-27444 RtspClient ExoPlayer com.test.myapplication E Playback error: Source error (Ask Gemini)
androidx.media3.exoplayer.ExoPlaybackException: Source error
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:865)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:841)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:246)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.io.IOException: SDP format error.
at androidx.media3.exoplayer.rtsp.RtspMediaPeriod$InternalListener.onSessionTimelineRequestFailed(RtspMediaPeriod.java:697)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.onDescribeResponseReceived(RtspClient.java:727)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspResponse(RtspClient.java:638)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspMessage(RtspClient.java:531)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.lambda$onRtspMessageReceived$0$androidx-media3-exoplayer-rtsp-RtspClient$MessageListener(RtspClient.java:524)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246) 
at android.os.HandlerThread.run(HandlerThread.java:67) 
Caused by: androidx.media3.common.ParserException: clock=20250319T200000Z-20250319T210000Z {contentIsMalformed=true, dataType=4}
at androidx.media3.exoplayer.rtsp.RtspMessageUtil.checkManifestExpression(RtspMessageUtil.java:477)
at androidx.media3.exoplayer.rtsp.RtspSessionTiming.parseTiming(RtspSessionTiming.java:51)
at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.onDescribeResponseReceived(RtspClient.java:725)

Expected result

exception

Actual result

exception

Media

Sorry, the URL is confidential, so I can't share it here, but it looks like this: 'rtsp://admin:admin@123@118.69.52.136:8554/Streaming/tracks/201?starttime=20250319T200000Z&endtime=20250319T210000Z'.

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.