androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.48k stars 343 forks source link

Automatic video quality does not work #824

Open Pamilg8 opened 9 months ago

Pamilg8 commented 9 months ago

Version

Media3 1.2.0

More version details

Automatic video quality does not work in LibreTube.They said it was related to Media3.We would appreciate it if you could fix your library and make the feature work in our application.

Devices that reproduce the issue

My Samsung A21s (Android 12).Many devices I've tested have had the problem.Works on YouTube.

Devices that do not reproduce the issue

No

Reproducible in the demo app?

Not tested

Reproduction steps

I can't use the demo application

  1. Play the video in LibreTube.
  2. Network quality is poor. Automatic selection selects the highest quality and does not change
  3. https://youtu.be/SCSu6BkRaug&t=0

    Expected result

Automatic select to adjust the quality according to the network.

Actual result

Auto selection doesn't work.Can't watch the video.

Media

Not applicable

Bug Report

marcbaechinger commented 9 months ago

Please elaborate a bit what is not working. The best way to demonstrate something isn't working is adding a media URI to the demo app and see whether this works. If it does not work add the media URI here in the issue and describe the steps how to repro the problem.

We are not evaluating other apps like LibreTube. If developers of an app say the problem is in ExoPlayer, they can apply the procedure from above and repro in the ExoPlayer main demo app.

Pamilg8 commented 9 months ago

I don't know how to use the demo application.The URL has been added to the issue. You probably know about automatic quality selection on YouTube. LibreTube runs an automatic quality selection that adjusts according to the network to optimize playback performance.

What is the problem? The highest video quality is selected and the automatic selection does not adjust the quality according to the network speed.YouTube doesn't have this problem

marcbaechinger commented 9 months ago

I don't think ExoPlayer can play YouTube videos directly I'm afraid. I'm not sure how LibreTube is doing this.

ExoPlayer has support for adaptive streaming by supporting DASH, HLS and SmoothStreaming. This includes an adaptive track selector that selects a format according to the available bandwidth. The demo app includes such formats and can be modified to try other media samples.

If a developer thinks that adaptive track selection for a stream does not work as intended, then they should file a bug with a sample stream and some reproduction steps. We are happy to help with this.

Pamilg8 commented 9 months ago

LibreTube runs streaming instances, not the YouTube API.Don't worry, that's another matter. We just need it as players. It's not about you and don't worry. LibreTube is legit.

Pamilg8 commented 9 months ago
1700481360.868 10410  8678 24735 I SurfaceView@5e0135d: 261995047 wPL, frameNr = 0
1700481360.868 10410  8678 24735 I SurfaceView@5e0135d: aOrMT: uB = true t = android.view.SurfaceControl$Transaction@bcf1e0b fN = 0 android.view.SurfaceView.access$500:124 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionLost:1785 android.graphics.RenderNode$CompositePositionUpdateListener.positionLost:326
1700481360.868 10410  8678 24735 I SurfaceView@5e0135d: aOrMT: vR.mWNT, vR = ViewRootImpl@b508fe6[IconBird]
1700481360.868 10410  8678 24735 I ViewRootImpl@b508fe6[IconBird]: mWNT: t = android.view.SurfaceControl$Transaction@bcf1e0b fN = 0 android.view.SurfaceView.applyOrMergeTransaction:1628 android.view.SurfaceView.access$500:124 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionLost:1785
1700481360.869 10410  8678 24735 I ViewRootImpl@b508fe6[IconBird]: mWNT: merge t to BBQ
1700481360.870 10410  8678  8678 I SurfaceView@5e0135d: windowStopped(true) false android.view.SurfaceView{5e0135d V.E...... ........ 0,0-720,405} of ViewRootImpl@b508fe6[IconBird]
1700481360.871 10410  8678  8678 I SurfaceView@5e0135d: pST: mTmpTransaction.apply, mTmpTransaction = android.view.SurfaceControl$Transaction@1acd309
1700481360.872 10410  8678  8678 I SurfaceView@5e0135d: surfaceDestroyed callback.size 1 #1 android.view.SurfaceView{5e0135d V.E...... ........ 0,0-720,405}
1700481360.873 10410  8678 30706 D SurfaceUtils: connecting to surface 0x7d6e70a010, reason connectToSurface
1700481360.873 10410  8678 30706 I MediaCodec: [OMX.Exynos.avc.dec] setting surface generation to 8886293
Pamilg8 commented 9 months ago

DASH stands for "Dynamic Adaptive Streaming over HTTP." Because it is based on HTTP, any origin server can be set up to serve MPEG-DASH streams. MPEG-DASH is similar to HLS, another streaming protocol, in that it breaks videos down into smaller chunks and encodes those chunks at different quality levels.There may be problems in the DASH part, that quality does not change automatically🤔