thielepaul / photoprism-mobile

Flutter App for PhotoPrism
GNU General Public License v3.0
892 stars 72 forks source link

Videos don't upload [android] #86

Open gomme600 opened 3 years ago

gomme600 commented 3 years ago

Any video bigger than a few MB doesn't upload, via auto-ypload the app just crashes and when restarting the upload the same thing happens again. The only way to resume auto-upload is to delete the video from the device... When uploading the same video manually the app doesn't crash but after fully uploading it to the server it returns an error, the server log doesn't show any activity. Uploading the same video from the web interface works. Thanks for any help with this!

gomme600 commented 3 years ago

Are there any updates on this yet? The developpement for this app seems pretty dead unfortunately. I am available for testing if need be.

thielepaul commented 3 years ago

my largest video is around 90MB and uploads just fine, how large are the videos we are talking about here? And are you úsing android or ios?

My priorities are currently at these two PRs (https://github.com/photoprism/photoprism-mobile/pull/96, https://github.com/photoprism/photoprism/pull/995), but I can look into this bug on the weekend.

gomme600 commented 3 years ago

Ok thanks. On Android 10, on a OnePlus 7t. Videos above a few megabytes, like 20. One very short 9 sec clip did upload at the very beginning I think. Almost any video seems to crash the upload, the app just crashes with no error and nothing in the logs. Restarting the upload does the same thing. The only way to resume is to delete the video from the phone. Then it crashes again on the next one. Uploading the same videos via the web GUI works fine. Uploading 1000s of photos from the app also works fine.

thielepaul commented 3 years ago

uploading through the web interface works well for the same video file, I suppose? The best thing to find the cause of this problem would be if you could install flutter, setup adb for your phone and then use flutter logs to to display the log output of the app. I will anyway check if I can reproduce this problem with larger video files.

thielepaul commented 3 years ago

ok, I think I found the problem (tried with 315MB video):

E/AndroidRuntime(10243): java.lang.OutOfMemoryError: Failed to allocate a 314757000 byte allocation with 25165824 free bytes and 253MB until OOM, target footprint 27632880, growth limit 268435456

I will need to think about how this can be fixed

gomme600 commented 3 years ago

Ok thanks

gomme600 commented 3 years ago

Do you still need the flutter logs?

thielepaul commented 3 years ago

I believe I fixed the problem. Can you test with the latest apk? https://github.com/photoprism/photoprism-mobile/releases/download/latest/photoprism.apk

gomme600 commented 3 years ago

Ok, so that seems to have helped! But now everything is marked as failed even if the photo does import into PhotoPrism!

thielepaul commented 3 years ago

Does the issue persist, if you use the "retry all failed" uploads option?

gomme600 commented 3 years ago

I tried and it didn't work unfortunately. The media does upload though. Resetting the app didn't work either. Here is the log. Thanks for all the help. Screenshot_20210212-193942 ![Uploading Screenshot_20210212-193946.jpg…]()

thielepaul commented 3 years ago

Seems like I fixed one bug and introduced another one. I hope it does work for you with the latest commit.

gomme600 commented 3 years ago

Just uninstalled and installed the latest version from GitHub and the upload is working again, waiting for it to upload a video to see if that works ok aswell.

Edit: A 30MB video just uploaded fine, waiting for some bigger ones.