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 streaming error: Malformed SDP line: i={contentIsMalformed=true, dataType=4} #1087

Closed
draskori opened this issue Feb 14, 2024 · 6 comments

Comments

@draskori
Copy link

draskori commented Feb 14, 2024

I am streaming from camera in local network (RTSP H.264) using androidx.media3:media3-exoplayer-rtsp:1.1.1 and I get following error in logcat:

Playback error

   androidx.media3.exoplayer.ExoPlaybackException: Source error
       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:684)
       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:660)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:154)
       at android.os.HandlerThread.run(HandlerThread.java:61)
   Caused by: java.io.IOException: androidx.media3.common.ParserException: Malformed SDP line: i={contentIsMalformed=true, dataType=4}
       at androidx.media3.exoplayer.rtsp.RtspMediaPeriod$InternalListener.onSessionTimelineRequestFailed(RtspMediaPeriod.java:689)
       at androidx.media3.exoplayer.rtsp.RtspClient.dispatchRtspError(RtspClient.java:322)
       at androidx.media3.exoplayer.rtsp.RtspClient.access$700(RtspClient.java:76)
       at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspResponse(RtspClient.java:682)
       at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspMessage(RtspClient.java:515)
       at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.lambda$onRtspMessageReceived$0$androidx-media3-exoplayer-rtsp-RtspClient$MessageListener(RtspClient.java:508)
       at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener$$ExternalSyntheticLambda0.run(D8$$SyntheticClass)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:154) 
       at android.os.HandlerThread.run(HandlerThread.java:61) 
   Caused by: androidx.media3.exoplayer.rtsp.RtspMediaSource$RtspPlaybackException: androidx.media3.common.ParserException: Malformed SDP line: i={contentIsMalformed=true, dataType=4}
@microkatz
Copy link
Contributor

@draskori

It seems that your camera is providing a malformed SDP description for its stream. Its supplying an "i" attribute which is a "session description" without a value. The SDP description are attribute-value pairs and so it cannot be empty.

Maybe there is some mechanism in the camera setup through which you can "name" the stream or fix it so that its not empty?

@draskori
Copy link
Author

Unfortunately there isn't such option in setup... But I can stream it with VLC or VideoView on some Android 7 for example

@skipt1206
Copy link

Reolink owner here, dealing with this problem also. I have reported the problem to Reolink but it looks like the rtsp protocol ( https://datatracker.ietf.org/doc/html/rfc4566 ) says the client end is supposed to ignore any session parameters that are not understood. (PS: I have written some specs in my day and I would say the spec could have been better written in this regard, but let's not go down that rabbit hole.)

2024-02-19_09-17

copybara-service bot pushed a commit that referenced this issue Feb 20, 2024
copybara-service bot pushed a commit to google/ExoPlayer that referenced this issue Feb 20, 2024
@microkatz
Copy link
Contributor

@draskori

I pushed a fix, commit 52c1d60, to the androidx/media main branch that should address your issue. It will allow an session information attribute with an empty value.

Hopefully that fixes your issue!

@skipt1206
As long as the unknown attribute letter contains a value, then ExoPlayer should ignore it. Are you running into an issue with custom SDP descriptions that ExoPlayer crashes on?

@skipt1206
Copy link

@draskori

I pushed a fix, commit 52c1d60, to the androidx/media main branch that should address your issue. It will allow an session information attribute with an empty value.

Hopefully that fixes your issue!

@skipt1206 As long as the unknown attribute letter contains a value, then ExoPlayer should ignore it. Are you running into an issue with custom SDP descriptions that ExoPlayer crashes on?

Thanks Michael. I am not a developer, but I have some experience working with developers. In this case I am trying to coordinate resolution of a problem getting Reolink camera rtsp to work with an app called Sparkle TV. Your fix should help a lot.

@microkatz
Copy link
Contributor

As the commit has fixed the initial problem I will close this issue. Please feel free to open a new ticket if an issue still exists.

SheenaChhabra pushed a commit that referenced this issue Apr 8, 2024
Issue: #1087
PiperOrigin-RevId: 608534659
(cherry picked from commit 52c1d60)
l1068 pushed a commit to l1068org/media that referenced this issue Apr 15, 2024
Issue: androidx#1087
PiperOrigin-RevId: 608534659
(cherry picked from commit 52c1d60)
@androidx androidx locked and limited conversation to collaborators May 6, 2024
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

3 participants