google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.01k forks source link

Player got stuck after receiving EventStream object #10746

Open javaboboApp opened 1 year ago

javaboboApp commented 1 year ago

When we are injecting in the manifest:

   <EventStream schemeIdUri="urn:scte:scte35:2014:xml+bin" timescale="1">
            <Event duration="0" id="66885518">
                <Signal xmlns="http://www.scte.org/schemas/35/2016">
                    <Binary>/DAgAAAAAAAAAP/wDwUAAAExf8/+HtpKgAABAAAAAMijVZM=</Binary>
                </Signal>
            </Event>
        </EventStream>

In the manifest the player gets stuck in BUFFERING state.

Exoplayer version: 2.17.1 Protocol used: DASH

Additional information: I am getting this in the event logs:

metadata [eventTime=0.48, mediaPos=17994.24, window=0, period=0 D/EventLogger: EMSG: scheme=urn:scte:scte35:2014:xml+bin, id=66885518, durationMs=0, value= D/EventLogger: ] So onMetadata is triggered but after a couple of seconds the player got stuck in buffering state.

I have sent an example of the manifest along with the bug report to the email.

marcbaechinger commented 1 year ago

Thanks for the manifest and the bug report!

For my education: what is the expected behaviour of this event in a live stream that gets a new manifest every 2 seconds? When looking into DashManifestParser I see that this gets parsed and the event gets a default presentationTime of 0. So I would expect this event is sent once when the stream starts or each time when the manifest is refreshed.

I'd expect that the event would be emitted immediately because of the default presentation time of 0. However, from what you say it looks like the metadata renderer gets stuck somehow? Naturally disabling the metadata renderer would make it work like without injecting the event.

So, obviously, It would be great to have such a live stream for testing if that's possible. That way I can see what is happening in ExoPlayer.

The logs in the bug report start with EventLogger timeline update reports when the player is already stuck. Seeing events before would be useful to see when stalling starts. Can you please make another bug report that starts before the player is created and prepared and the metadata output is reported in the logs?

javaboboApp commented 1 year ago

Hi @marcbaechinger thanks for replying. I already sent more information via email. We are using EventStream to get a sign and finish playback once we got this sign but not for rendering purposes. So idea is:

  1. User is watching content for 2 hours.
  2. We send a sign (EventStream) unparse it and check that we should finish playback.
  3. We end the playback

So the problem that I observed is that playbacks get stuck after receiving the event stream.

marcbaechinger commented 1 year ago

Before I start trying to repro this. Did you have any success with your experiment of injecting that event stream into the Dash manifest with any other player that play that as expected?

javaboboApp commented 1 year ago

I have used explayer demo app, but I am still seeing how the player stops after x seconds of getting EventStream injected with the signal.

javaboboApp commented 1 year ago

Hi @marcbaechinger , after doing some tests, I have realised that the problem is that I was using Map Local in order to inject EventStream object. I started to use rewrite (charles proxy option) and the player is working as expected.

Other things if we have a Event with presentationTime = 1000 , timeScale =1 , PeriodStartInSeconds = windows.defaultPositionInMs/1000.

The event start time should not be: ST = PeriodStartInSeconds - presentationTime/timeScale ??

So if for example we have a PeriodStartInSeconds = 17975.04 seconds

The start time of event would be = 17975.04 - 1000 = ..

I am following documentation: https://dashif-documents.azurewebsites.net/Events/master/event.html#mpd-event-timing

Reason that I am asking this is that I have to set a really big number presentationTime in order to avoid triggering the event...