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

Streaming with VLC doesn't work, internal player has no sound #4903

Closed
InfamousUser opened this issue Nov 29, 2019 · 36 comments
Closed

Streaming with VLC doesn't work, internal player has no sound #4903

InfamousUser opened this issue Nov 29, 2019 · 36 comments
Labels

Comments

@InfamousUser
Copy link

InfamousUser commented Nov 29, 2019

Actual behaviour

Video doesn't start streaming by going to "Stream with..." and selecting VLC. Internal player doesn't work for the particular video in question - no sound.

Expected behaviour

Video streams.

Steps to reproduce

  1. Press "Stream with..." on the desired video.
  2. Video loads indefinitely in VLC.

Environment data

Android version:

Device model: Google Pixel 2

Stock or customized system: stock

Nextcloud app version: 3.19.0

Nextcloud server version: 22.2.3

Logs

Web server error log

Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here

NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate

@stale
Copy link

stale bot commented Dec 27, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label Dec 27, 2019
@InfamousUser
Copy link
Author

It has been fixed, you can close the issue.

Just kidding, please fire the bot.

@stale stale bot removed the stale label Dec 27, 2019
@stale
Copy link

stale bot commented Jan 24, 2020

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label Jan 24, 2020
@InfamousUser
Copy link
Author

Issue has been fixed in the latest release.

Just kidding, please fire the bot.

@stale stale bot removed the stale label Jan 24, 2020
@stale
Copy link

stale bot commented Feb 21, 2020

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added stale and removed stale labels Feb 21, 2020
@tobiasKaminsky
Copy link
Member

There is an experimental switch to another video player in #8132 (comment)

This apk can be installed in parallel.
It would be great if you can give this a test, if it helps in your scenario.

@InfamousUser
Copy link
Author

I somehow missed this, I can test, sure, if there's a new apk. Currently in 3.16.0 RC2 neither internal player nor streaming works.

@InfamousUser
Copy link
Author

Any update on this? I see that the referenced player change has been merged but as of 3.19 the problem remains...

@AlvaroBrey
Copy link
Member

AlvaroBrey commented Feb 17, 2022

Any update on this? I see that the referenced player change has been merged but as of 3.19 the problem remains...

VLC streaming:

After some digging I've found the following:

  • Streaming videos using VLC seems to not work. Some videos work for a couple of seconds and then freeze, others never load in the first place.
  • Streaming videos with any other app (like the default Gallery app in LineageOS) works.

Additionally, opening the same nextcloud stream URL (http://{server}/remote.php/direct/{stream id}) directly from the VLC app doesn't work either, but works in (for example) the desktop VLC app. My conclusion is that this is in fact a bug with the VLC app and not the Nextcloud app.

No sound for video:

This seems more interesting. What is the format and codec of this video? Does it have sound if you download it first and then play it?

@InfamousUser
Copy link
Author

InfamousUser commented Feb 17, 2022

Thanks for the response. Well that is interesting, do you know of any other Google Play app that supports "Stream with..."? And is this bug reported anywhere in the Videolan community?

The format of the one video that doesn't work is Matroska, video codec is H.265, audio codec is A/52 B, if I download it first by pressing download under the menu, it then doesn't have sound if played by tapping on it. In the player, under settings, it has "None" under Audio.

@AlvaroBrey
Copy link
Member

Thanks for the response. Well that is interesting, do you know of any other Google Play app that supports "Stream with..."?

I tried the default Gallery in LineageOS, and Just (Video) Player from GPlay.

And is this bug reported anywhere in the Videolan community?

No idea 🤷

The format of the one video that doesn't work is Matroska, video codec is H.265, audio codec is A/52 B, if I download it first by pressing download under the menu, it then doesn't have sound if played by tapping on it. In the player, under settings, it has "None" under Audio.

Noted, will try. Thanks!

@InfamousUser
Copy link
Author

Okay, I got streaming to work with Google Photos app, had to allow it Internet access first - no sound as well...
Tried a different file, Matroska, H.264, DTS audio, same thing.
MP4 file with H.264 and MPEG AAC audio works, audio works in streaming app...
MP4 file with H.265 and A52 audio, no sound again, no sound in streaming app.
I fail to see how the app opening a stream would have trouble getting an audio when it's just opening a stream... Doesn't it just get access to the data and it does what it wants with it?
Doesn't look like format incompatibility at first glance.

@AlvaroBrey
Copy link
Member

AlvaroBrey commented Feb 18, 2022

Okay, I got streaming to work with Google Photos app, had to allow it Internet access first - no sound as well... Tried a different file, Matroska, H.264, DTS audio, same thing. MP4 file with H.264 and MPEG AAC audio works, audio works in streaming app... MP4 file with H.265 and A52 audio, no sound again, no sound in streaming app. I fail to see how the app opening a stream would have trouble getting an audio when it's just opening a stream... Doesn't it just get access to the data and it does what it wants with it? Doesn't look like format incompatibility at first glance.

Maybe those particular audio codecs are unsupported in your device/android and the audio players you've tried (Google Photos, and our app's player) use ExoPlayer which just uses the device codecs. If that's the case then this is related to #9804; the app should just show an "audio codec not supported" message to avoid confusion.

@AlvaroBrey
Copy link
Member

Maybe those particular audio codecs are unsupported in your device/android and the audio players you've tried (Google Photos, and our app's player) use ExoPlayer which just uses the device codecs. If that's the case then this is related to #9804; the app should just show an "audio codec not supported" message to avoid confusion.

For reference, VLC probably does support those codecs as it should use its own codec lib, but due to its streaming bug you'll probably need to download the file first...

@InfamousUser
Copy link
Author

Okay, so out of 3 streaming options, 3 options have issues. I will probably report this bug to Videolan, Google Photos is a trash app if it doesn't support multiple codecs for a 200 billion dollar company that specializes in software... And I guess I can understand Nextcloud's issue, but the last time I've had issues with codecs or formats or even thought about the codec or format before watching something was probably 10-15 years ago, VLC has spoiled us all...

It would be great if it said it doesn't support the codec first of all, like you said - so people know what the heck the issue even is. Is it possible to add support for all codecs? I'm sure I'm not an isolated case.

@InfamousUser
Copy link
Author

InfamousUser commented Feb 18, 2022

Wow, I actually managed to open it in VLC... Streaming does work, but you need to wait many minutes for it to load. There is something wrong here. It is not an Internet connection bottleneck, the server is doing something weird, looks like the server is preloading the whole file from storage before starting to stream, which can take ages for multi-GB file. How do I deal with this? I mean I'm sure my server isn't the fastest but pulling the whole file from storage is not what I would expect or even consider "streaming"... This is 100% not what any user would expect of this function. Do I open an issue for Nextcloud server or what?

Edit: well it looks like it depends on the file whether it will preload the whole file or not. I have a feeling this is something to do with non-interleaved audio and file being only linearly seekable. There is an issue here with something but I don't know what exactly...

@AlvaroBrey
Copy link
Member

It would be great if it said it doesn't support the codec first of all, like you said - so people know what the heck the issue even is.

Yep, I added a note to #9804 to track this.

Is it possible to add support for all codecs? I'm sure I'm not an isolated case.

Not really. As I've said it's device-dependent. The only way would be to use libVLC or something like that, but that's not easy to implement or maintain, and mostly a bad idea overall.

Streaming does work, but you need to wait many minutes for it to load

In my testing at least I couldn't get VLC to load at all, while other players loaded instantly. I don't think the server is doing anything weird with the file. I would encourage you to open an issue in the VLC for android repo, to see if anyone more knowledgeable about VLC can help you find out the cause of the problem.

Meanwhile I'll be closing this issue. The codec warnings should be handled by #9084, and the streaming is a problem with the VLC app, which we don't maintain. Thank you for your patience

@InfamousUser
Copy link
Author

InfamousUser commented Feb 18, 2022

In my testing at least I couldn't get VLC to load at all, while other players loaded instantly. I don't think the server is doing anything weird with the file. I would encourage you to open an issue in the VLC for android repo, to see if anyone more knowledgeable about VLC can help you find out the cause of the problem.

I've reproduced this with Google Photos as well, it works instantly for some files, and it takes ages for others, I can see Nextcloud server saturating 1 Gbps connection to storage server while the app is waiting to play, then the network traffic drops and the file starts playing. Looks like it isn't isolated to VLC only.

@AlvaroBrey
Copy link
Member

AlvaroBrey commented Feb 18, 2022

I've reproduced this with Google Photos as well, it works instantly for some files, and it takes ages for others, I can see Nextcloud server saturating 1 Gbps connection to storage server while the app is waiting to play, then the network traffic drops and the file starts playing. Looks like it isn't isolated to VLC only.

Can you try this with VLC desktop, just to rule out the android part? You can get the video stream URL from ADB after trying to stream with VLC:

adb logcat | grep "Fetching media from mrl"

And then just open that URL as a network stream in VLC desktop. For me this works 100% of the time on the videos I've tested, even if the Android app doesn't.

If you still find that some videos don't stream properly, even in desktop, then open an issue in github.com/nextcloud/server

@InfamousUser
Copy link
Author

InfamousUser commented Feb 18, 2022

That command doesn't find it for some reason, although I used Select-String as there's no grep in crap Windows. Very hard to do any of this in it, not to mention selecting in PS is horrendous experience. I manually found the https://server.com/remote.php/direct/ address and tried opening that in Windows VLC - it works but takes ages to start, same as with Android.

From first opening the file in Windows VLC till it started playing took about 4 minutes. Seeking the video caused stream to pause and after 3 minutes stop.
Second file took almost 6 minutes, and that was a significantly larger file.
Third file took 5 minutes.
Fourth file took 5 minutes.

Btw, have you tried opening it with Android VLC and just leaving it loading for 10 minutes to see if it opens?

@szaimen
Copy link
Contributor

szaimen commented Feb 18, 2022

@InfamousUser are you using the external storage app on the server side?

@InfamousUser
Copy link
Author

Using a Server Message Block share, having data on Nextcloud server is severely inconvenient.

@szaimen
Copy link
Contributor

szaimen commented Feb 18, 2022

Then is this the problem. I reported the issue with external storage already multiple times. I still think that this is an issue of the android app and not the server...

@AlvaroBrey
Copy link
Member

AlvaroBrey commented Feb 18, 2022

Then is this the problem. I reported the issue with external storage already multiple times. I still think that this is an issue of the android app and not the server...

As stated above, opening the stream URL directly from the VLC app, or even Windows VLC (without involving the Nextcloud app at all) gives the same results.

@szaimen
Copy link
Contributor

szaimen commented Feb 18, 2022

@AlvaroBrey But why does playing mp4 files using the built-in player work in my testing but not when selecting the option to stream it with vlc? What does the built-in player do differently in comparison to selecting the option to stream with vlc?

@szaimen
Copy link
Contributor

szaimen commented Feb 18, 2022

There is nothing that's being done differently for other apps and for VLC, and yet VLC doesn't work, but others do.

Okay, thanks for the insights! Which ones do work in you experience?

@AlvaroBrey
Copy link
Member

@AlvaroBrey But why does playing mp4 files using the built-in player work in my testing but not when selecting the option to stream it with vlc? What does the built-in player do differently in comparison to selecting the option to stream with vlc?

I think you and I have a different scenario from @InfamousUser :

  • For @InfamousUser some files seem to take too long to load, both on VLC desktop, and through "Stream with..." VLC or Google Photos. This looks like a server issue.

  • For me (and probably for you too), files fail to load in VLC Android but work in other players, and also can be loaded without problem in VLC desktop. This looks like a bug with VLC Android.

Neither of these looks like a problem with the Nextcloud app.

@AlvaroBrey
Copy link
Member

Okay, thanks for the insights! Which ones do work in you experience?

As stated above, I've tried both the built-in Gallery app in LineageOS, and Just (Video) Player from Google Play and both work.

Disclaimer: i don't know about the trustworthiness of the latter app. I just searched for "open source video players android" and picked one.

@szaimen
Copy link
Contributor

szaimen commented Feb 18, 2022

okay, thanks for your answers! So I guess this should be reported to vlc android. I'll see if I can open a bug tickets there.

@InfamousUser
Copy link
Author

Have you both tried opening it through VLC on Android and leaving it open for a very long time to see if it loads? Like 10-30 minutes?

@szaimen
Copy link
Contributor

szaimen commented Feb 18, 2022

no I didn't try that but it should not take this long to load especially if other apps handle it without problem.

@szaimen
Copy link
Contributor

szaimen commented Feb 18, 2022

@szaimen
Copy link
Contributor

szaimen commented Feb 18, 2022

@AlvaroBrey are you sure that the internal player does the same like external apps? to me it looks like external apps will get an url that looks like this: https://yourdomain.com/remote.php/direct/some-random-string which is based on the docs meant for external applications so the internal player probably uses something else internally? Maybe the direct endpoint is broken?

@AlvaroBrey
Copy link
Member

@AlvaroBrey are you sure that the internal player does the same like external apps? to me it looks like external apps will get an url that looks like this: https://yourdomain.com/remote.php/direct/some-random-string which is based on the docs meant for external applications so the internal player probably uses something else internally? Maybe the direct endpoint is broken?

External stream: http://github.com/nextcloud/android/blob/2b639f288b211bf24fc35315f32980be627939cd/src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java#L457-L457

Internal stream: http://github.com/nextcloud/android/blob/2b639f288b211bf24fc35315f32980be627939cd/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java#L514-L514

As you can see, the same code is used to fetch the URL. Also, the android app is probably considered an "external application" by the server folks 😉

@szaimen
Copy link
Contributor

szaimen commented Feb 18, 2022

Thanks! So then it definitely seems to be a bug in the vlc app, hence the linked issue :)

@InfamousUser
Copy link
Author

Thanks for opening the VLC issue!

Don't know why I'm getting different results than you guys, I will do some further investigation and then pile onto the bandwagon and/or open an issue in the server tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants