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

Video not loading when using piped-bg-helper-server #6985

Open
3 tasks done
mdbraber opened this issue Jan 20, 2025 · 5 comments
Open
3 tasks done

Video not loading when using piped-bg-helper-server #6985

mdbraber opened this issue Jan 20, 2025 · 5 comments
Labels
bug Something isn't working help wanted Looking for help

Comments

@mdbraber
Copy link

Steps to reproduce

Instructions using Docker:

  1. Install piped-bg-helper-server:Add to your docker-compose.yml:
piped-bg-helper-server:
  image: 1337kavin/bg-helper-server:latest
  container_name: piped-bg-helper-server

Add to Piped-Docker/config/config.properties:

BG_HELPER_URL:http://piped-bg-helper-server:3000
  1. Restart docker containers
docker compose down && docker compose up -d 
  1. Try to load a video in LibreTube

Expected behavior

Video should load

Actual behavior

Video gives a "Network error" (using HLS) or a "Source error" with DASH

LibreTube version

0.26.0 (58)

Android version

Android 12

Other details

Error from the Android Studio debugger:

2025-01-17 20:58:45.531  8426-8792  LoadTask                com.github.libretube.debug           E  Unexpected exception loading stream
                                                                                                      java.lang.ArrayIndexOutOfBoundsException: src.length=65536 srcPos=-542817018 dst.length=65536 dstPos=0 length=542817018
                                                                                                          at java.lang.System.arraycopy(Native Method)
                                                                                                          at androidx.media3.extractor.DefaultExtractorInput.updatePeekBuffer(DefaultExtractorInput.java:266)
                                                                                                          at androidx.media3.extractor.DefaultExtractorInput.skipFromPeekBuffer(DefaultExtractorInput.java:232)
                                                                                                          at androidx.media3.extractor.DefaultExtractorInput.skipFully(DefaultExtractorInput.java:105)
                                                                                                          at androidx.media3.extractor.DefaultExtractorInput.skipFully(DefaultExtractorInput.java:117)
                                                                                                          at androidx.media3.extractor.mkv.DefaultEbmlReader.read(DefaultEbmlReader.java:149)
                                                                                                          at androidx.media3.extractor.mkv.MatroskaExtractor.read(MatroskaExtractor.java:594)
                                                                                                          at androidx.media3.exoplayer.source.chunk.BundledChunkExtractor.read(BundledChunkExtractor.java:241)
                                                                                                          at androidx.media3.exoplayer.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:132)
                                                                                                          at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:421)
                                                                                                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
                                                                                                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
                                                                                                          at java.lang.Thread.run(Thread.java:920)
2025-01-17 20:58:45.549  8426-8694  ExoPlayerImplInternal   com.github.libretube.debug           E  Playback error
                                                                                                      androidx.media3.exoplayer.ExoPlaybackException: Source error
                                                                                                          at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:736)
                                                                                                          at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:712)
                                                                                                          at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                                          at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                          at android.os.Looper.loop(Looper.java:288)
                                                                                                          at android.os.HandlerThread.run(HandlerThread.java:67)
                                                                                                      Caused by: androidx.media3.exoplayer.upstream.Loader$UnexpectedLoaderException: Unexpected ArrayIndexOutOfBoundsException: src.length=65536 srcPos=-542817018 dst.length=65536 dstPos=0 length=542817018
                                                                                                          at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:442)
                                                                                                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
                                                                                                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
                                                                                                          at java.lang.Thread.run(Thread.java:920)
                                                                                                      Caused by: java.lang.ArrayIndexOutOfBoundsException: src.length=65536 srcPos=-542817018 dst.length=65536 dstPos=0 length=542817018
                                                                                                          at java.lang.System.arraycopy(Native Method)
                                                                                                          at androidx.media3.extractor.DefaultExtractorInput.updatePeekBuffer(DefaultExtractorInput.java:266)
                                                                                                          at androidx.media3.extractor.DefaultExtractorInput.skipFromPeekBuffer(DefaultExtractorInput.java:232)
                                                                                                          at androidx.media3.extractor.DefaultExtractorInput.skipFully(DefaultExtractorInput.java:105)
                                                                                                          at androidx.media3.extractor.DefaultExtractorInput.skipFully(DefaultExtractorInput.java:117)
                                                                                                          at androidx.media3.extractor.mkv.DefaultEbmlReader.read(DefaultEbmlReader.java:149)
                                                                                                          at androidx.media3.extractor.mkv.MatroskaExtractor.read(MatroskaExtractor.java:594)
                                                                                                          at androidx.media3.exoplayer.source.chunk.BundledChunkExtractor.read(BundledChunkExtractor.java:241)
                                                                                                          at androidx.media3.exoplayer.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:132)
                                                                                                          at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:421)
                                                                                                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
                                                                                                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
                                                                                                          at java.lang.Thread.run(Thread.java:920) 

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I will fill out all of the requested information in this form.
@mdbraber mdbraber added the bug Something isn't working label Jan 20, 2025
@Bnyro Bnyro added the help wanted Looking for help label Jan 20, 2025
@FineFindus
Copy link
Contributor

I've implemented PoToken support in my fork, using the NewPipeExtractor fork from Piped, and I can't reproduce this error. Maybe the Piped server is parsing/sending the playback chunks incorrectly?

@mdbraber
Copy link
Author

mdbraber commented Jan 20, 2025

@FineFindus I've cherry-picked the commit in your fork but I'm getting exactly the same errors so I'm not sure what's going on. This is suspicious to me:

java.lang.ArrayIndexOutOfBoundsException: src.length=65536 srcPos=-542817018 dst.length=65536 dstPos=0 length=542817018

It seems that length is wrong? Or that src.length is limited to a max as it suspicious that it seems like some kind of upper value.

@mdbraber
Copy link
Author

@FineFindus it seems that also my pre-PoToken version was nit working with DASH, only HLS. What Piped (Backend) version are you using on your instance?

@FineFindus
Copy link
Contributor

I've cherry-picked the commit in your fork

Have you added a PoToken and enabled local feed extraction? I don't think the LocalFeedRepository is loaded otherwise and therefore the PoTokenProvider not set.

@mdbraber
Copy link
Author

mdbraber commented Jan 20, 2025

Ah wait, you're not using an instance as you've built a 'local feed extraction' that works without an instance? No I've not done that but I could - interesting add-on (if I'm getting it right).

What seems to work with a Piped instance is to (re)enable ump and srfvp that were disabled in this PR TeamPiped/Piped-Backend#791. That makes LibreTube work again and also web and Yattee seem to still work. I haven't exhaustively tested but I think Yattee might sometimes jump around which could be related to TeamPiped/Piped#2517

I'm not sure if this is the best solution, maybe ump should be enabled just for Android which might be related to ytproxy and this issue TeamPiped/piped-proxy#238

@FireMasterK can you elaborate whether (re)enabling ump and srfvp is a good solution for Piped-Backend? @Bnyro mentioned it might make fingerprinting easier as YT clients don't use them. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Looking for help
Projects
None yet
Development

No branches or pull requests

3 participants