nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.17k stars 1.75k forks source link

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

Closed Se7endevil closed 3 years ago

Se7endevil commented 4 years ago

Steps to reproduce

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

Expected behaviour

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

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

tobiasKaminsky commented 4 years ago

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

Se7endevil commented 4 years ago

Dear Tobias Kaminsky

I try use VLC can play video Thank you for support

Se7endevil commented 4 years ago

I will upload file m2ts to app nextcloud. but can't show play video and not streaming external app.

BR.

tobiasKaminsky commented 4 years ago

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

Wotisrv commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Dear Team nextcloud

    Thank you for support
    I will use VLC.
    it can fast forward and play continue.

Best regards. Setta

ในวันที่ พฤ. 7 พ.ค. 2020 เวลา 09:25 nijezauzeto notifications@github.com เขียนว่า:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nextcloud/android/issues/5917#issuecomment-624991421, or unsubscribe https://github.com/notifications/unsubscribe-auth/APJV6FHKWEKETI5N7PISYS3RQILX3ANCNFSM4MOXK2PA .

Wotisrv commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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[bot] commented 4 years ago

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!

sjauquet commented 4 years ago

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

sjauquet commented 4 years ago

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[bot] commented 4 years ago

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!

szaimen commented 4 years ago

ping

Wotisrv commented 4 years ago

pong

sjauquet commented 4 years ago

Yep, problem still not solved...

Wotisrv commented 4 years ago

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 commented 4 years ago

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

stale[bot] commented 4 years ago

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!

sjauquet commented 4 years ago

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!

tobiasKaminsky commented 4 years ago

are those video files in normal storage or on some kind of external storage?

Wotisrv commented 4 years ago

My video files are stored on the servers intern harddisk. No external storage.

sjauquet commented 4 years ago

In my case I tested with both cases, internal hard disk and/or shared folder samba. Same behavior. Thanks !

szaimen commented 4 years ago

my case: I am using the external storage app with local storage.

tobiasKaminsky commented 4 years ago

Is VLC working for you?

sjauquet commented 4 years ago

in the chrome browser on my samsung note 9, both local and remote are playing. in owncloud app, none of them plays. when I "share" with VLC player, owncloud "downloads" the file, open vlc but no playing and exits back to owncloud app. Found the downloaded file with my file manager app, then share to vlc app makes the file to play fine. Not sure why owncloud app cannot send the video to VLC or play it. Thanks

tobiasKaminsky commented 4 years ago

@sjauquet owncloud or Nextcloud app? :see_no_evil:

sjauquet commented 4 years ago

Nextcloud, sorry ...

farbenh commented 3 years ago

Any chance that built-in player will work similar to external like VLC? Video player stop every time after 5 to 12 seconds..

tobiasKaminsky commented 3 years ago

We completely rely on Android's built in media player. VLC has more codecs as far as I know, and might have more error handling… I fear this will be a tough task to be as good as VLC…

sjauquet commented 3 years ago

In my case those are mainly videos created by the same phone, not a codec problem then. The video files are simply not downloaded when clicking play, by VLC or Nextcloud app. But the nextcloud can download them without any problem when asked. Once stored on the phone the file are played without problem. It seems like the play routine has differences that makes it unable to download the file to play it later, or stream it ? Thanks !

farbenh commented 3 years ago

We completely rely on Android's built in media player. VLC has more codecs as far as I know, and might have more error handling… I fear this will be a tough task to be as good as VLC…

This is no codec issue couse player can handle video but stop playing after few seconds. This is some buffer issue rather than codec issue I think. I'm using gDrive, degoo and one drive app whic agree using built-in player and no issue with them. Could be good also to let users to choose external player as default...

tobiasKaminsky commented 3 years ago

It seems like the play routine has differences that makes it unable to download the file to play it later, or stream it ?

@rullzer as you implemented this, do you have an idea?

stale[bot] commented 3 years ago

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!

tobiasKaminsky commented 3 years ago

Ping @rullzer ?

stedevo commented 3 years ago

I noticed a different webserver access behavior between nc mobile app and webbrowser for the same video-file:

Webbrowser request - nginx access.log: (note: 1 request)

IP-ADDR - - [06/Nov/2020:15:19:30 +0100] "GET /remote.php/dav/files/bla/videos/blub.mp4 HTTP/2.0" 206 46956782 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0"

nc mobile app request - nginx access.log: (note: many request)

IP-ADDR - - [06/Nov/2020:15:20:18 +0100] "GET /remote.php/direct/gO1DB1UdnFvwuzMMak2dupeXWsY2BuPHTOUcyUK HTTP/1.1" 200 1047900 "-" "stagefright/1.2 (Linux;Android 10)"
IP-ADDR - - [06/Nov/2020:15:20:21 +0100] "GET /remote.php/direct/gO1DB1UdnFvwuzMMak2dupeXWsY2BuPHTOUcyUK HTTP/1.1" 206 25722144 "-" "stagefright/1.2 (Linux;Android 10)"
IP-ADDR - - [06/Nov/2020:15:20:22 +0100] "GET /remote.php/direct/gO1DB1UdnFvwuzMMak2dupeXWsY2BuPHTOUcyUK HTTP/1.1" 206 1309982 "-" "stagefright/1.2 (Linux;Android 10)"
IP-ADDR - - [06/Nov/2020:15:20:22 +0100] "GET /remote.php/direct/gO1DB1UdnFvwuzMMak2dupeXWsY2BuPHTOUcyUK HTTP/1.1" 206 1817886 "-" "stagefright/1.2 (Linux;Android 10)"
IP-ADDR - - [06/Nov/2020:15:20:23 +0100] "GET /remote.php/direct/gO1DB1UdnFvwuzMMak2dupeXWsY2BuPHTOUcyUK HTTP/1.1" 206 1752350 "-" "stagefright/1.2 (Linux;Android 10)"
IP-ADDR - - [06/Nov/2020:15:20:23 +0100] "GET /remote.php/direct/gO1DB1UdnFvwuzMMak2dupeXWsY2BuPHTOUcyUK HTTP/1.1" 206 2129182 "-" "stagefright/1.2 (Linux;Android 10)"
IP-ADDR - - [06/Nov/2020:15:20:24 +0100] "GET /remote.php/direct/gO1DB1UdnFvwuzMMak2dupeXWsY2BuPHTOUcyUK HTTP/1.1" 206 2309406 "-" "stagefright/1.2 (Linux;Android 10)"
...

Is the android app supposed to issue that amount of requests?

tobiasKaminsky commented 3 years ago

We only fetch it when clicking on play button… Have you clicked multiple times? Else it is maybe something internal by Android's video player…

stedevo commented 3 years ago

No, one tab only on the video file...

tobiasKaminsky commented 3 years ago

Strange, I tried it and it worked with only one request:

127.0.0.1 - tobi [13/Nov/2020:08:11:51 +0100] "POST /nc/ocs/v2.php/apps/dav/api/v1/direct?format=json HTTP/1.1" 200 185 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.0 Alpha1"
127.0.0.1 - - [13/Nov/2020:08:11:51 +0100] "GET /nc/remote.php/direct/BIjbSkq5feDDKWwf4KnmQHakJqu9R1KvpbPUPwYOmQc6HhsXnPOZ3aClakzG HTTP/1.1" 200 1137202 "-" "stagefright/1.2 (Linux;Android 10)"

On my side I see HTTP 200, but you have HTTP 206. @rullzer as you implemented it, do you know when/why 206 is sent?

Wotisrv commented 3 years ago

After updating Nextcloud to 20.0.2 and Nextcloud Android app to 3.14 I get this error in the Android app when trying to play any videofil:

************ CAUSE OF ERROR ************

android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{8b024dd u0 com.nextcloud.client/.media.PlayerService}
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1872)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7050)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

************ APP INFORMATION ************
ID: com.nextcloud.client
Version: 30140090
Build flavor: gplay

************ DEVICE INFORMATION ************
Brand: samsung
Device: dreamlte
Model: SM-G950F
Id: PPR1.180610.011
Product: dreamltexx

************ FIRMWARE ************
SDK: 28
Release: 9
Incremental: G950FXXSBDTJ1
tobiasKaminsky commented 3 years ago

Should be fixed via #7340

axe1OO4 commented 3 years ago

Hi, any updates on the solution to this problem?

I have the same problem running mp4 with my android, but when i tried using iphone, it just works fine..

j4ym0 commented 3 years ago

Hi

i am having the same issue on the 3.14.3 android app.
If you use the webapp though the chrome android app or other web browsers, there is no skipping (stoping after 4 to 15 seconds for about 45 seconds)

Wotisrv commented 3 years ago

Problem still persisting. I switched from Samsung S8 to S20. Updated both my server and Nextcloud to the latest. I can also confirm the same behavior with iphone. Streaming is working flawlessly by using mobile browsers og browser on PC.

sjauquet commented 3 years ago

Hello, the problem is still here an Galaxy Note 9. Thanks

zolokonst commented 3 years ago

On my Xperia with Android 7.1 the same behavior after update to the latest app version. streaming to VLC doesn't work. (infinite loading). But works streaming to internal "album" app. There are no new lines in the server log. (Server is up to date now. But it doesn't affect on a mp4 playing) I tried fully remove an app from device. Don't care. It looks like connection problem. (I opened another issue #7839 about ipv6) Or like some thread blocks main socket.

Steps to reproduce in my case:

kbhuinfo commented 3 years ago

Hi! I have the same problem with some clients/phones. Mine works perfectly, till I use chrome for android. If I use stock browser, the video shows the unfamous "Error loading filename.mp4". That tells me, that the problem is on client side - they should use an advanced browser like chrome. On server side, I can't find any problems. (sorry for hijacking, I didn't notice it is about nextcloud app)

adosix commented 3 years ago

Same issue not trusted certificates and video stream doesn t work, But I suppose it won t be solved as the issue is there several months already. :(