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

I can't play video file mp4 on app nextcloud #5917

Closed
Se7endevil opened this issue Apr 23, 2020 · 90 comments · Fixed by #8132
Closed

I can't play video file mp4 on app nextcloud #5917

Se7endevil opened this issue Apr 23, 2020 · 90 comments · Fixed by #8132

Comments

@Se7endevil
Copy link

Steps to reproduce

  1. Upload file Video mp4
  2. Install nextcloud on mobile
  3. Login and grant permission and play video file

Expected behaviour

  • Tell us what should happen
    I will can watch video on app nextcloud

Actual behaviour

  • Tell us what happens
    I can't watch video on app nextcloud

Can you reproduce this problem on https://try.nextcloud.com?

  • Please create a test demo account and see if this still happens there.
  • If yes, please open up a bug report
  • If not, please verify server setup and ask for help on forum

Environment data

Android version:
9
Device model:
G8142 Sony Xperia XZ Premium
Stock or customized system:
Stock 47.2.A.10.107
Nextcloud app version:
3.11.0
Nextcloud server version:
16.0.3
Reverse proxy:

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

@Se7endevil Se7endevil added the bug label Apr 23, 2020
@tobiasKaminsky tobiasKaminsky added the needs info Waiting for info from user(s). Issues with this label will auto-stale. label Apr 23, 2020
@tobiasKaminsky
Copy link
Member

You are talking about streaming, right?
Is this also happening with en external video player, e.g. VLC?

@Se7endevil
Copy link
Author

Se7endevil commented Apr 23, 2020 via email

@Se7endevil
Copy link
Author

Se7endevil commented Apr 23, 2020 via email

@tobiasKaminsky
Copy link
Member

Not sure if m2ts is supported.
Can you first try it with a regular mpeg2 file?

@Wotisrv
Copy link

Wotisrv commented Apr 30, 2020

I can confirm almost the same issue on an Samsung Galaxy S8 with latest NC app 3.11. With NC app version lower 3.11 there was never a problem to stream smoothly mp4 files directly in the app. No matter file size and quality.
Since updated to 3.11 just small files are streaming with a lot of buffering. Large files do not load or take almost hours to load.
The same happens when using vlc og mediaplayer on mobilephone.

Streaming the same mp4 files in webbrowser is working fine as expected.

@nijezauzeto
Copy link

So, I have ran into a similar issue with two android phones (OnePlus 5T and OnePlus 6T), NC app 3.11.1 installed.

Tested with both the "default" intro video file that came with the installation (Nextcloud intro.mp4) as well as manually uploaded video.
When opening over the Web browser, it works flawlessly.
When opening from within the app, it gets stuck on loading for exactly 30 seconds before it says "The built-in media player is unable to play the media file. Sorry."
In the app logs, this is the only error I could find:
2020-05-07T01:25:35.403+0100;E;PreviewMediaFragment;Error in video playback, what = 1, extra = -2147483648

When opening from the app using "Stream with..." and picking VLC, it gets stuck on the loading part for almost precisely 300 seconds before it starts buffering/downloading the file (I don't see any real bandwidth being used before then, doesn't really matter so much on the size of the file, after which it starts to play the file in VLC).

I have also tested it with https://demo2.nextcloud.com, and built-in player works fine actually on android app, no issues.

I don't see anything useful in the app logs except that one line, and nextcloud.log doesn't have anything in this time frame at all.

@nijezauzeto
Copy link

Just a quick update, once I have enabled LetsEncrypt certs on my NC server, everything is working fine in the app. Seems that if the certs are not trusted on Android, it will fail to stream properly for some reason.

@Se7endevil
Copy link
Author

Se7endevil commented May 7, 2020 via email

@Wotisrv
Copy link

Wotisrv commented May 7, 2020

Just a quick update, once I have enabled LetsEncrypt certs on my NC server, everything is working fine in the app. Seems that if the certs are not trusted on Android, it will fail to stream properly for some reason.

I am using LetsEncrypt certs. Is there a way to update certs in the NC app without reinstalling the app?

@nijezauzeto
Copy link

I believe this would happen on its own if you were to remove your current account from the app. Once you get to the "Log in" page and enter the URL of your server with the valid certs, it should refresh them into the app, but that is only a guess.
Basically I have enabled LetsEncrypt on the server side, deleted my account from the app and used app code from the security tab to authenticate against the app. After that all worked on its own. I haven't done anything with the certs on the android/app itself.

@stedevo
Copy link

stedevo commented May 11, 2020

I can confirm almost the same issue on an Samsung Galaxy S8 with latest NC app 3.11. With NC app version lower 3.11 there was never a problem to stream smoothly mp4 files directly in the app. No matter file size and quality.
Since updated to 3.11 just small files are streaming with a lot of buffering. Large files do not load or take almost hours to load.
The same happens when using vlc og mediaplayer on mobilephone.

Streaming the same mp4 files in webbrowser is working fine as expected.

I can confirm the same issue on my Huawei P30 with latest NC app 3.11 even after reinstalling the android app and login with new app token. VLC and Webbrowser are working fine.

@stale
Copy link

stale bot commented Jun 9, 2020

This bug report 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 Jun 9, 2020
@sjauquet
Copy link

Hello, same problem here, videos plays on desktop but not on app.
The video files are from a SMB share mounted with "external storage" plugin.
The Nextcloud intro.mp4 doesn't work either.
Phone: Galaxy note 9.
.

@stale stale bot removed the stale label Jun 18, 2020
@sjauquet
Copy link

sjauquet commented Jul 1, 2020

Tested with the mobile website in chrome on my galaxy note 9 and it works.
So only the app cannot retrieve the file, and even if I want to make it play with an external player, that player would not receive the file.
So it looks like it not event the app that cannot play, it's the app that don't receive the .mp4 at all

@stale
Copy link

stale bot commented Jul 29, 2020

This bug report 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 Jul 29, 2020
@szaimen
Copy link
Contributor

szaimen commented Jul 29, 2020

ping

@stale stale bot removed the stale label Jul 29, 2020
@Wotisrv
Copy link

Wotisrv commented Jul 30, 2020

pong

@sjauquet
Copy link

Yep, problem still not solved...

@Wotisrv
Copy link

Wotisrv commented Jul 30, 2020

Problem is not solved even with the latest upgrades on both Fedora Linux Server with all necessary packages and NC 19.0.1 as well as NC mobile Android app.

@xander89ab
Copy link

I approve, have same failure with playing video in android app 3.11 version. Specially tried 3.10 - video plays correctly.

@stale
Copy link

stale bot commented Sep 5, 2020

This bug report 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 Sep 5, 2020
@sjauquet
Copy link

sjauquet commented Sep 6, 2020

still unresolved ;-)

This bug report 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 removed the stale label Sep 6, 2020
@marinofaggiana
Copy link
Member

At start download from 0 to end and when has a minimum buffer start the video, when you seek video him stop the download and start a new download from seek to end, when has all the data the video is abailable in offline (download completed). In network you can fin several material or lib for a proxy

@tobiasKaminsky
Copy link
Member

Thanks for insights how you handle it on iOS.

Maybe we can wait for buffer: https://developer.android.com/reference/android/widget/VideoView#getBufferPercentage()

And if this is too low, we wait and resume automatically if buffer is filled again.

@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.

@Wotisrv
Copy link

Wotisrv commented Mar 8, 2021

I am testing the development apk. Where to wright comments? This edition is playing fine all my videofiles, no matter what filesize.

Missing: full-screen support
Issue: when clicking back while video is playing the video does not stop. It continues playing in the background. Sound is playing but no video to see and no possibility to stop. Need to reboot the mobile phone.
Clicking stop first and so back is working fine.

@tobiasKaminsky
Copy link
Member

Thanks for testing.
Then this is the way to go, and to make this working reliable.
As it was only a quick & dirty test, such problems like playing all the time or no full screen were expected.

@tobiasKaminsky tobiasKaminsky removed this from the Nextcloud App 3.14.1 milestone Mar 9, 2021
@tobiasKaminsky tobiasKaminsky added approved pr exists and removed needs info Waiting for info from user(s). Issues with this label will auto-stale. labels Mar 9, 2021
@Wotisrv
Copy link

Wotisrv commented Mar 9, 2021

Will that have an effect on NC app for iOS too?

@szaimen
Copy link
Contributor

szaimen commented Mar 9, 2021

Will that have an effect on NC app for iOS too?

No. Why/how should it?

@Wotisrv
Copy link

Wotisrv commented Mar 9, 2021

Will that have an effect on NC app for iOS too?

No. Why/how should it?

My mistake. I expressed myself wrong.
For a while ago I wrote in the thread that I observed the same behavior with the NC app on iOS and also got feedback from users using the NC app on iOS, that they cannot stream. Now I thought, if the ExoPlayer is the solution in the NC app for Android, is it maybe also for iOS? Sorry if I'm wrong.

@szaimen
Copy link
Contributor

szaimen commented Mar 9, 2021

Since the Exoplayer is only for Android, this won't be possible.
But videostreaming does already work with the NC iOS app, in my experience...

@Wotisrv
Copy link

Wotisrv commented Mar 9, 2021

Ok thanks for feedback. I will take a more accurate test with iOS and not mix it here.

@karezza
Copy link

karezza commented Jul 14, 2021

Setting up valid certs fixed this for me. Valid certs (not self-signed certs) are required to watch the media via the nextcloud app. In my case I have a certificate authority setup on windows server 2019, generate a csr on the client system, sign the cert on the ca, then present those two @ nextcloud/appdata/keys/cert.key & nextcloud/appdata/keys/cert.crt .

@Hidri02
Copy link

Hidri02 commented Jul 31, 2021

Apparently the android app requires TLSv1.2 when using WiFi. I had TLSv1.2 disabled in my ssl config, re-enabling it fixed it for me.
This also fixed another issue I had with not being able to upload files while on WiFi.

@Viceman256
Copy link

Setting up valid certs fixed this for me. Valid certs (not self-signed certs) are required to watch the media via the nextcloud app. In my case I have a certificate authority setup on windows server 2019, generate a csr on the client system, sign the cert on the ca, then present those two @ nextcloud/appdata/keys/cert.key & nextcloud/appdata/keys/cert.crt .

Do you know a way to do this with a Linux system? I just installed Nextcloud for the first time, uploaded 20 GB of my media, then tried streaming from my android and the video never loads. Tried "Stream with" to VLC and Plex, no luck. I don't want to make it public facing, it's solely for encrypted shared media storage between my home devices. But it seems, if the case is that it needs a proper cert, it's impossible to get it working without assigning a public domain to it?

@karezza
Copy link

karezza commented Jan 12, 2022 via email

@Viceman256
Copy link

Viceman256 commented Jan 12, 2022

Even with self signed certificates the Certificate Authority, the certificates you used to sign with, has a public and private key. On your PC you have probably said to trust a self signed certificate, and after that it stopped giving you an error. Same thing applies with a mobile device. You can add the public key of the CA to your mobile and you'll be good to go after that. You can Google to find help with words like, "how to add ca chain to phone android".

I'm aware of how to add a CA chain, but unsure how to get a CA working on a Linux system. If I was hosting NextCloud on Windows, I could follow your instructions above and simply paste those certs in their respective folders.

@karezza
Copy link

karezza commented Jan 12, 2022 via email

@Viceman256
Copy link

Try googling, "use linux as certificate authority". Is that what you are looking to do? If yes, find an article for your Linux distribution and I might be able to help out if you get stuck.

I can do that, but it doesn't help me with configuring anything on a NextCloud VM image for access. And that's only part of the equation, this is a stock NextCloud VM image. I need to be able to stream video from NextCloud to the Android app, but all I have is your comment stating a Windows CA cert helped you. No confirmation or update from NextCloud. There's no guarantee installing a third party CA (and potential security risk) and deploying a cert would work, nor does it seem possible.

@karezza
Copy link

karezza commented Jan 12, 2022 via email

@Viceman256
Copy link

Unfortunately, appdata doesn't exist in Linux. You would have to somehow integrate them into Apache I believe, and I have no clue how to even begin that. I've already had two instances get corrupt for trying to edit the configs, so it's frustrating there is a lack of documentation for it.

I used the full VM, https://www.hanssonit.se/nextcloud-vm/.

@lexvx
Copy link

lexvx commented Oct 29, 2022

The problem is still there. Streaming in android APP not working.
Just installed the old version of the app (v3.10) and everything works fine in it.
Streaming in the application for iPhone works correctly.

@im-n1
Copy link

im-n1 commented Aug 1, 2024

I just bumped into this but on NC 29 and I use browser as a client.

  • I use Firefox (latest to this date)
  • when I open video via Files menu item it starts loading and i see in NC log that my nginx starts to streaming the file
nextcloud_proxy  | 192.168.88.10 - - [01/Aug/2024:17:52:36 +0000] "GET /remote.php/dav/files/n1/photos/UNSORTED/VID_20240722_223008_HDR10PLUS.mp4 HTTP/1.1" 206 2377635 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0" "-"

When I try to access the file on the URL from log downloading in my browser starts to I guess the file gets served just fine. However NC files start loading the player and then I get
image

and developer console in my browser is full of errors

image

@j4ym0
Copy link

j4ym0 commented Aug 1, 2024

@im-n1 Looking at you Firefox log. You don't have the correct codec installed for Firefox to load the video. Firefox on Linux uses libavcodec to play most MP4 files. Try sudo apt install libavcodec

@im-n1
Copy link

im-n1 commented Aug 2, 2024

@j4ym0

I just tried and the lib is installed (I even updated it to 61).
image

The vedio test page https://tekeye.uk/html/html5-video-test-page play mp4 just fine. Looks like mp4 is totally playable in my browser. It it possible that it might be just the video I try to play? Or anything else?

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

Successfully merging a pull request may close this issue.