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

Cannot play rtsp stream #9544

Open
LupuFlaviu opened this issue Oct 8, 2021 · 7 comments
Open

Cannot play rtsp stream #9544

LupuFlaviu opened this issue Oct 8, 2021 · 7 comments
Assignees
Labels

Comments

@LupuFlaviu
Copy link

I've integrated the library in a simple test app where I just want to play a rtsp stream. When I try to play this public rtsp stream (rtsp://demo:[email protected]:5541/onvif-media/media.amp?profile=profile_1_h264&sessiontimeout=60&streamtype=unicast) that uses DIGEST authentication I get a "DESCRIBE 503" error. I've posted some logs below, maybe they are more helpful. Sometimes the stream is played, but most of the times I get the error above. It's very strange.
Using rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov works fine.
Can someone have a look and point out the problem and possible solutions to fix it? Thank you
rtsp-fail.txt

@andrewlewis
Copy link
Collaborator

@claincly Please could you take a look?

@claincly
Copy link
Contributor

claincly commented Oct 8, 2021

In general a 5xx error signals some sort of server error.

But in order to investigate on our end,please provide a log of RTSP messages.

The easiest way is to use the RtspMediaSource.Factory method setDebugLoggingEnabled()

@LupuFlaviu
Copy link
Author

I'm keen to think the same, that the server is the problem but I wanted to double check, maybe something is missing/done wrong in the ExoPlayer. Or does someone have other rtsp streams to share? Preferably with authentication.

I cannot find the setDebugLoggingEnabled() method if I get the dependency from the Google Maven repository. Should I add it as a module of my app? In that case, what branch should I use?

Also I think for best debugging you can simply try to add "rtsp://demo:[email protected]:5541/onvif-media/media.amp?profile=profile_1_h264&sessiontimeout=60&streamtype=unicast" url to your ExoPlayer sample app and try to play the stream. It should give you the same error. Try a few times as it may be the case it works sometimes :)

@claincly
Copy link
Contributor

claincly commented Oct 8, 2021

I'll try the link thanks!

For future reference, this is how to build exoplayer using that factory method:

     SimpleExoPlayer player =
          new ExoPlayer.Builder(/* context= */ this)
              .setMediaSourceFactory(new RtspMediaSource.Factory().setDebugLoggingEnabled(true))
              .build()

@LupuFlaviu
Copy link
Author

Got you the logs that you asked for.
rtsp-logs-enabled.txt

@LupuFlaviu
Copy link
Author

LupuFlaviu commented Oct 12, 2021

@claincly I also found another possible problem. When using Basic authentication, the header is constructed as "Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
Shouldn't it be "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" as stated here https://en.wikipedia.org/wiki/Basic_access_authentication ?

@NicolasGodfather
Copy link

Should it be: "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", why missing word "Basic" ?

icbaker pushed a commit that referenced this issue Apr 26, 2022
Issue: #9544

The header must include the word "Basic", but the word is missing.

#minor-release

PiperOrigin-RevId: 443386880
icbaker pushed a commit to androidx/media that referenced this issue Apr 26, 2022
Issue: google/ExoPlayer#9544

The header must include the word "Basic", but the word is missing.

#minor-release

PiperOrigin-RevId: 443386880
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants