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

Got this error when play the srt stream. #2

Closed
Earyongan opened this issue Nov 22, 2023 · 10 comments
Closed

Got this error when play the srt stream. #2

Earyongan opened this issue Nov 22, 2023 · 10 comments

Comments

@Earyongan
Copy link

Playback error com.google.android.exoplayer2.ExoPlaybackException: Source error

@Earyongan
Copy link
Author

Earyongan commented Nov 22, 2023

is it correct to set like this?

val url = "srt://live.cloudflare.com:778";
val passphrase = ""
var mediaId = "";

val mediaItem = MediaItem.Builder()
    .setMediaId(mediaId)
    .setUri(url)
    /**
     * From SRT socket option: "The password must be minimum 10 and maximum
     * 79 characters long."
     */
    .setCustomCacheKey(passphrase)
    .build()

@ThibaultBee
Copy link
Owner

Hello there,

Your URL looks like a contribution URL (from camera to server) and not a delivery (from server to player). It would be weird that Cloudflare uses SRT for delivery. If it is a contribution URL, it don't understand what you are trying to achieve. Contact cloudflare support.

I suppose setMediaId is your streamid.
See

srt://ip.of.my.computer:9998?streamid=mystream

Finally, you should keep your id and passphrase secret.

@Earyongan
Copy link
Author

    "srt": {
      "url": "srt://live.cloudflare.com:778",
      "streamId": "...",
      "passphrase": "..."
    },
    "srtPlayback": {
      "url": "srt://live.cloudflare.com:778",
      "streamId": "...",
      "passphrase": "..."
    },
This is the response from cloudflare, and I want to playback with srtplayback, is it possible? I use ffmpeg to test and it working.

@Earyongan Earyongan reopened this Nov 24, 2023
@ThibaultBee
Copy link
Owner

As I said, see

srt://ip.of.my.computer:9998?streamid=mystream

val url = "srt://live.cloudflare.com:778?streamid=mystream";
val passphrase = "mypassphrase"

val mediaItem = MediaItem.Builder()
    .setUri(url)
    /**
     * From SRT socket option: "The password must be minimum 10 and maximum
     * 79 characters long."
     */
    .setCustomCacheKey(passphrase)
    .build()

I think this should be okay.

@Earyongan
Copy link
Author

Earyongan commented Nov 24, 2023

2023-11-25 02:13:19.373  7436-7480  CCodec                  io.github.thibaultbee.srtplayer      D  setup formats output: AMessage(what = 0x00000000) = {
int32_t android._color-format = 2135033992
int32_t android._video-scaling = 1
int32_t rotation-degrees = 0
int32_t color-standard = 1
int32_t color-range = 2
int32_t color-transfer = 3
int32_t sar-height = 1
int32_t sar-width = 1
Rect crop(0, 0, 1279, 719)
int32_t width = 1280
int32_t height = 720
int32_t max-height = 720
int32_t max-width = 1280
string mime = "video/raw"
int32_t android._dataspace = 260
int32_t color-format = 2130708361
}

And the screen show black screen

@Earyongan
Copy link
Author

It working fine when I testing with ffplay

@ThibaultBee
Copy link
Owner

Nice. You did connect.
The stream has been decoded.

I am sorry, I don't want to spend much time on the maintenance. Here are a few things that could help you:

  • Could you try to test with an older commit?
  • Could you try to increase latency?

@Earyongan
Copy link
Author

Earyongan commented Nov 25, 2023

I already test with older commit and increase the latenc, but the player show only black screen.

@umairsajid0017
Copy link

Yes Same problem, FFplay is playing but This media player is not

@ThibaultBee
Copy link
Owner

Hi,

Did you fix the issue? If yes, how?

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

No branches or pull requests

3 participants