ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

During DAI live stream, frame freeze happens during content to ad switch or ad to content switch

Open gb103 opened this issue 2 years ago • 9 comments

ExoPlayer Version

2.15.1

Devices that reproduce the issue

Redmi Note 9 Pro

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

Used a DAI enabled live stream, of which manifest is like as in the attached file, dai_hls_manifest.txt dai_hls_manifest.txt

Things to note into this manifest file, for Bandwidth - 1646672 , RESOLUTION=1280x720 & for bandwidth - 2310816, RESOLUTION=1280x720 is same as above

When ad transition happens and frame freeze occurs below logs appear,

D/EventLogger: downstreamFormat [eventTime=224.66, mediaPos=96.88, window=0, period=0, id=4, mimeType=null, bitrate=1646672, codecs=avc1.640020,mp4a.40.2, res=1280x720, fps=50.0] D/EventLogger: videoInputFormat [eventTime=224.69, mediaPos=96.91, window=0, period=0, id=4, mimeType=video/avc, bitrate=1646672, codecs=avc1.64001E, res=768x432, fps=50.0]

For Same bitrate, there are 2 different resolution appears in downStreamFormat event and videoInputFormat event, as per my understanding downStreamFormat resolution is coming from the manifest but the videoInputFormat resolution is from the actual .ts file.

So I do have below questions/or raising bugs,

  1. Is my understanding correct regarding resolution calculation for downstreamFormat and videoInputFormat
  2. Can we conclude that, this frame freeze happens due to this mismatch (Because for my case, conflict in the res is always whenever freeze happens)
  3. should it be reported on google dai to make their resolution right or should this be handled on exoplayer, I think it should be both.

Expected result

Exoplayer should handle the resolution difference in the manifest and in the actual chunk, there should be no frame freeze

Actual result

Frame freeze happens during content to ad and ad to content switch

Media

NA

Bug Report

  • [ ] You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

gb103 avatar Aug 03 '22 03:08 gb103

D/EventLogger: downstreamFormat [eventTime=224.66, mediaPos=96.88, window=0, period=0, id=4, mimeType=null, bitrate=1646672, codecs=avc1.640020,mp4a.40.2, res=1280x720, fps=50.0] D/EventLogger: videoInputFormat [eventTime=224.69, mediaPos=96.91, window=0, period=0, id=4, mimeType=video/avc, bitrate=1646672, codecs=avc1.64001E, res=768x432, fps=50.0]

For Same bitrate, there are 2 different resolution appears in downStreamFormat event and videoInputFormat event, as per my understanding downStreamFormat resolution is coming from the manifest but the videoInputFormat resolution is from the actual .ts file.

The codecs are also different, which might be a bigger deal. From RFC 8216 section 6.2.4:

If an EXT-X-STREAM-INF tag or EXT-X-I-FRAME-STREAM-INF tag contains the CODECS attribute, the attribute value MUST include every media format [RFC6381] present in any Media Segment in any of the Renditions specified by the Variant Stream.


If you fix the manifest to have the correct resolution and codec is the issue resolved?

icbaker avatar Aug 03 '22 09:08 icbaker

Do you see any problem in the manifest which I have attached, as per me it is correct.

Different resolution in the logs comes when DAI ad content is about to play, correcting resolution of the ad chunk it's not in our control.

gb103 avatar Aug 03 '22 10:08 gb103

It's not really possible to investigate further without access to the stream in order to reproduce the problem ourselves. Please either post a link here or send it to [email protected] using a subject in the format Issue #1234 (where #1234 should be replaced with this issue number). Please also update this issue to indicate you’ve done this.

icbaker avatar Aug 03 '22 11:08 icbaker

@icbaker sent an email with test liveDAI stream, it will be live for next 24 hours. Request you to test it at earliest. Thanks.

gb103 avatar Aug 04 '22 10:08 gb103

Playing the stream with no VPN returns me HTTP 403 errors:

internalError [eventTime=1.43, mediaPos=0.00, window=0, loadError
  com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
      at com.google.android.exoplayer2.ext.cronet.CronetDataSource.open(CronetDataSource.java:726)
      at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:201)
      at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:776)
      at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:589)
      at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
      at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:99)
      at com.google.android.exoplayer2.upstream.DataSourceInputStream.open(DataSourceInputStream.java:62)
      at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:174)
      at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
      at java.lang.Thread.run(Thread.java:1012)

I then VPN'd to India (which I guessed based on the phone number in your email signature), and it fails with the same error.

Are there additional steps I need to take in order to access this stream? Please specify repro instructions in full.

icbaker avatar Aug 04 '22 11:08 icbaker

Can you please try with okHttpDataSource or HttpDataSource instead of Cronet ? Steps ;

  1. Play the video
  2. let's be on a throttling network (if possible be it around at 1000 - 2000 KBPS throttled network)
  3. At around ~1700 KBPS during ad transition video seems to be freezed

If you even run the shared url on safari, it is working fine.

gb103 avatar Aug 04 '22 13:08 gb103

I get a 403 with OkHttp too:

internalError [eventTime=8.52, mediaPos=0.00, window=0, loadError                                               
  com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403        
      at com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.open(OkHttpDataSource.java:323)              
      at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:201)              
      at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:776)  
      at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:589)            
      at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)                   
      at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:99)
      at com.google.android.exoplayer2.upstream.DataSourceInputStream.open(DataSourceInputStream.java:62)       
      at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:174)                  
      at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)                            
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)                        
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)                        
      at java.lang.Thread.run(Thread.java:1012)                                                                 

icbaker avatar Aug 04 '22 13:08 icbaker

@icbaker Shared a new stream url.

gb103 avatar Aug 05 '22 05:08 gb103

@icbaker sorry to remind you again but test stream has limited validity, can you please confirm if the new stream url is playing for you ?

gb103 avatar Aug 05 '22 09:08 gb103

Closing this because all the streams provided failed to load. If you're still experiencing this please re-open with a non-time-limited stream that is globally accessible that we can use to reproduce..

icbaker avatar Oct 06 '22 13:10 icbaker