libre-tube / LibreTube

An alternative frontend for YouTube, for Android.
https://libretube.dev
GNU General Public License v3.0
8.04k stars 430 forks source link

Video not playing in DASH format #5855

Open VitoItalianGamer opened 3 months ago

VitoItalianGamer commented 3 months ago

Steps to reproduce

1.Watch a video by searching or whatever 2.the video remains black and no sound

Expected behavior

The video plays like normal

Actual behavior

The video remains black and plays only in HLS

LibreTube version

0.22.2

Android version

Android 12

Other details

Was it of next DNS or libretube itself

Acknowledgements

ngn13 commented 3 months ago

To fix 1002 errors Piped project disabled ump with this commit: https://github.com/TeamPiped/Piped-Backend/commit/d5572d70a77ca6db1d0381bd506ae85cf8047468

Which breaks DASH for some reason

VitoItalianGamer commented 3 months ago

Can you guys fix this issue?

Not-A-Coder2023 commented 3 months ago

This happened to me just recently

consoleaf commented 3 months ago

This happened to me just recently

Try disabling DASH in settings. Worked for me, probably will for you as well

QuestioningEspecialy commented 3 months ago

This happened to me just recently

Try disabling DASH in settings. Worked for me, probably will for you as well

This did it for me. Settings -> Audio and video -> Quality -> Use HLS

edit: GrapheneOS Android 14 Pixel 6a

edit2: it pauses every few minutes now, though

anoo2niem commented 3 months ago

For those using libretube with a selfhosted piped server with docker, where switching to HLS doesn't seem to work and where the backend got updated recently by watchtower;

1337kavin/piped@sha256:afa51dbe3089686e42e894a405dabf7cc6f649b739c4f801c766153bf7a96a3c is the image with digestID just before the update that disabled UMP and breaks DASH as mentioned by @ngn13.

Currently using this image, back up and running, till the issue git fixed.

0x24D commented 3 months ago

Debug log shows the issue comes from ExoPlayer:

playerFailed [eventTime=2.76, mediaPos=0.00, window=0, period=0, errorCode=ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE
                   androidx.media3.exoplayer.ExoPlaybackException: Source error
                       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:713)
                       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:685)
                       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.datasource.cronet.CronetDataSource$OpenException
                       at androidx.media3.datasource.cronet.CronetDataSource.skipFully(CronetDataSource.java:928)
                       at androidx.media3.datasource.cronet.CronetDataSource.open(CronetDataSource.java:676)
                       at androidx.media3.datasource.DefaultDataSource.open(DefaultDataSource.java:275)
                       at androidx.media3.datasource.StatsDataSource.open(StatsDataSource.java:86)
                       at androidx.media3.exoplayer.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:129)
                       at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:421)
                       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)
                 ]

The DASH manifest created using PlayerHelper::createDashSource works fine using other video player, including Piped (shaka-player).

VitoItalianGamer commented 3 months ago

I'm using hls and the auto generated captions don't appear.

CarlosRuiz-globalqss commented 3 months ago

I'm using hls and the auto generated captions don't appear.

same here - DASH is not working, and HLS is slow and without automatic subtitles

Bnyro commented 3 months ago

I am getting

Caused by: androidx.media3.common.ParserException: Invalid integer size: 8101{contentIsMalformed=true, dataType=1}
                                                                                                          at androidx.media3.extractor.mkv.DefaultEbmlReader.read(DefaultEbmlReader.java:121)
                                                                                                          at androidx.media3.extractor.mkv.MatroskaExtractor.read(MatroskaExtractor.java:514)
                                                                                                          at androidx.media3.exoplayer.source.chunk.BundledChunkExtractor.read(BundledChunkExtractor.java:149)
                                                                                                          at androidx.media3.exoplayer.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:129)
                                                                                                          at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:414)
                                                                                                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                          at java.lang.Thread.run(Thread.java:1012)

I've logged and compared requests from Piped and LibreTube at the proxy's side, and they're pretty much identical. So I suspect that when disabling ump, YouTube's video format is different and thus no longer compatible with the ExoPlayer, while Shaka does handle things differently at the Piped frontend on the web.

I've tested downgrading the ExoPlayer version - without any notable changes.

ARR552 commented 3 months ago

This happened to me just recently

Try disabling DASH in settings. Worked for me, probably will for you as well

This worked for me as well but only for the video. It is still failing in audio mode...

Ehab-d commented 3 months ago

This worked for me as well but only for the video. It is still failing in audio mode...

The audio player did not respect the Use HLS setting and always used DASH. This issue was resolved in #5862. You can expect it to be resolved in the next release or try the nightly builds.

VitoItalianGamer commented 2 months ago

How do I enable UMP in libretube?

aviallon commented 2 months ago

Would implementing an MPV player fix the issue? MPV can play almost every thing, after all. I know Findroid (native Android client for Jellyfin) had a very good MPV player integration that just works when enabled.

VitoItalianGamer commented 2 months ago

I got Findroid how do I add a server to it?

sonisaltiner commented 2 months ago

Greetings. Is there a problem with entity? Occasionally entitys starting with the prefix Kavin disappear. If I select any other occurrence, there are problems, some things stay loading.

Moonstone3010 commented 2 months ago

Hi, I've been having the same problem for (I think) a few weeks now. No video is playing, it shows the message: source error. This is independent of the instance. Piped in the browser works on the same device. A workaround for this problem is to disable the piped proxy. When videos are sucked directly from YT everything works. The second solution is to enable HLS instead of DASH, but - as someone wrote above - in version 0.22.2 this does not work in audio-only mode.

edit: I also tested last nightly and HLS audio-only playback works, but the main problem remains unsolved.

sonisaltiner commented 2 months ago

@Moonstone3010 Thank you for your reply. Solution 2 seems to work. Solution 1 causes a different problem. The videos open but do not play. I hope you are working on these issues.

Bnyro commented 2 months ago

Please ONLY comment here if you have useful information on how to solve the issue at LibreTube's or Piped proxy's side.

It's not helpful to say that the issue exists for you too - everybody has the same issue...

VitoItalianGamer commented 2 months ago

I know everybody has the same issue and when will the issue be fixed?

aviallon commented 2 months ago

@Bnyro could something like an automatic fallback be implemented?

Also, I think trying to use MPV as the player might help there, although it would probably be a major pita to add.

0xrxL commented 1 month ago

@Bnyro could something like an automatic fallback be implemented?

Also, I think trying to use MPV as the player might help there, although it would probably be a major pita to add.

Yeah...at this point I think that too. Maybe the current player implementation lack of some codec, useful to correctly decode the video stream.

0xrxL commented 1 month ago

UPDATE: seems DASH working again on this debug build, I can even watch the age restricted videos (with a custom piped instance, obviously), but there's no specifically merged code related to it.

What happened? 🤔🤷‍♂️

Bnyro commented 1 month ago

UPDATE: seems DASH working again on this debug build, I can even watch the age restricted videos (with a custom piped instance, obviously), but there's no specifically merged code related to it.

What happened? 🤔🤷‍♂️

You certainly disabled the proxy ...

0xrxL commented 1 month ago

UPDATE: seems DASH working again on this debug build, I can even watch the age restricted videos (with a custom piped instance, obviously), but there's no specifically merged code related to it. What happened? 🤔🤷‍♂️

You certainly disabled the proxy ...

I checked it, and it's disabled. But I wasn't able to make restricted video working on current stable version (also with proxy disabled).

So I wondered if there was a fix (or fixes) merged recently.

Bnyro commented 1 month ago

No ...

Pamilg8 commented 1 month ago

The YouTube app uses the Android Testsuite or the iOS YouTube API instead of the default Android YouTube API for video player requests. This is why the videos don't work. But how can the problem be solved? Maybe in NewPipe Extractor. But in NewPipe, videos open smoothly. Maybe this should be fixed in Piped

mckellenjaundice122 commented 1 month ago

Ever since December I haven't been able to use the app at all, nothing has changed, it's just as broken even with all the default settings. Only way I can get anything to play is to disable the piped proxy, the hls setting does absolutely nothing whether off or on for me

Pamilg8 commented 1 month ago

Ever since December I haven't been able to use the app at all, nothing has changed, it's just as broken even with all the default settings. Only way I can get anything to play is to disable the piped proxy, the hls setting does absolutely nothing whether off or on for me

YouTube blocks LibreTube and servers are sometimes down (initial player not response). It seems that the ipv6 rotator is not implemented. YouTube proxy is not reliable. NewPipe is more stable. Innertube or NewPipe Extractor as additional support would be great

VitoItalianGamer commented 1 month ago

I'll install New Pipe until LibreTube fixes the DASH problem

codenyte commented 1 month ago

NewPipe is more stable. Innertube or NewPipe Extractor as additional support would be great

I'll install New Pipe until LibreTube fixes the DASH problem

You can simply disable the proxying in the settings. Go to settings -> Instance and select 'Disable Piped proxy'. That setting will make LibreTube basically act just like NewPipe.

BatDevil commented 1 month ago

i have the same issue here, video not loading at all but for specific channels like Ohara, Joseph Blaze and TheAvatarist.

VitoItalianGamer commented 1 month ago

Ok

VitoItalianGamer commented 1 month ago

But there is no auto generated captions.

Not-A-Coder2023 commented 1 week ago

unrelated but apparently adding a channel to a group crashes libretube debug

codenyte commented 1 week ago

unrelated but apparently adding a channel to a group crashes libretube debug

@Not-A-Coder2023 Please open a new issue for that