deckerst / aves

Aves is a gallery and metadata explorer app, built for Android with Flutter.
BSD 3-Clause "New" or "Revised" License
2.79k stars 106 forks source link

Video edit issue - hangs with loader over the screen #1305

Closed artem-tarasenko closed 6 days ago

artem-tarasenko commented 6 days ago

Describe the bug Cannot shorten the video's length in the editor screen. When I set a new timeframe and press "save as a copy" the loader overlay pops up and nothing happens.

To Reproduce Steps to reproduce the behavior:

  1. Open videos collection
  2. Pick any random video (22 sec in my case)
  3. ...edit - set a new timeframe - save as a copy
  4. See loading spinner as if the process work but it never disappears

Expected behavior Wait for it to finish, spinner disappears, UI unblocks

Screenshots Screenshot_20241118_184155_Photos

System information and logs: Package: deckers.thibault.aves Installer: com.android.vending Aves version: 1.11.17-play, build 136 Flutter: stable 3.24.4 Android version: 14, API 34 Android build: UP1A.231005.007.S918WVLU4CXI5 Device: samsung SM-S918W Support: dynamic colors=true, geocoder=true, HDR=true Mobile services: ready Connectivity: wifi System locales: ru_RU, en_CA Storage volumes: /storage/emulated/0/ Storage grants: /storage/emulated/0/DCIM/, /storage/emulated/0/Android/media/ Error reporting: false

aves-logs-20241118_184218.txt

Additional context Add any other context about the problem here.

deckerst commented 6 days ago

Aves does not include a video editor. It forwards to editing apps installed on your device.

artem-tarasenko commented 6 days ago

Wait, what? Forwarding where? I don't recognize that UI (surely not the default app) and it looks like it is still Aves. I also haven't found any settings specifying editing applications.

Can you give a little more details about that before closing it?

deckerst commented 6 days ago

When you press "edit" in Aves, it tells the OS it wants to edit an image/video, and the OS looks for apps that can handle it. If there's only one app that can do it, it opens that app right away.

If there are several apps that can handle it, it shows a dialog that lets the user choose which app and whether to use this app "always" or "only once". That dialog is a standard OS dialog. If you choose "always", it will not prompt you again in the future and use that app without asking.

I don't know in your case whether 1) you have just one video editing app, or 2) you have several but in the past you used one of them and pressed "always".

I can't help you identify which editing app is used. It could be the default gallery editor, Google Photos editor, etc.

deckerst commented 6 days ago

To identify the available apps for the editing intent, maybe you could use that app as interceptor: https://www.f-droid.org/en/packages/io.github.muntashirakon.AppManager/

artem-tarasenko commented 6 days ago

Ah I see, thanks for the detailed response.

The source of confusion for me was the absence of a dialogue to choose the editor. I'm pretty sure I didn't pick any options first time I opened the app, not to mention the option "always" (not my habit, but just in case I re-installed the app and checked editing once more - there was no dialogue.

I found out, however, where the "edit" was transferred by by opening a video via the default file manager (there was no default option, so I picked all options one by one) - it is a google picture.

After that I picked a default (proper) video player as a default option ("always" open with..) and get back to the app to see if it will use my choice to edit a video - and it didn't, again tried to open with google pics. Is there any way to resolve that?

Thanks.

artem-tarasenko commented 6 days ago

Here is the video of the first launch of the app. https://github.com/user-attachments/assets/5ad4dc52-ee83-4986-8f57-775d2ff79543

deckerst commented 6 days ago

When an app (here, Google Photos) is used as a default, it's not specific to the calling app (here, Aves). It's set at the OS level. So if you want to reset defaults, you need to go to the OS settings > Apps > Google Photos > Open by default > Clear default preferences.

Also, default apps are associated to specific "intents". The "opening" intent is not the same as the "editing" intent. So you can have App A as the default app to open videos, and App B as the default app to edit videos.

artem-tarasenko commented 6 days ago

Alright, with your help I figured out why G.Photos was unable to edit videos - since I've never used it the app didn't have permissions...

I checked the settings as you pointed out:

I don't know why but things seem to be working not exactly as intended here. If "reset defaults" doesn't clear "edit" intent then how? I'm gonna do a few more tests with defaults to understand it better...

deckerst commented 6 days ago

It is very likely that Google Photos is the only app able to edit videos on your device. In that case there is no dialog prompting to choose, because there is no choice.

artem-tarasenko commented 6 days ago

It was, I deleted it and Aves said "there are no apps to edit", which doesn't make sense, because I have a default app for that, plus I've installed a few more - GoPro Quik, Adobe Express and a bunch of project-based apps. Could it be the "intent" is somehow different...? I mean, on my device (Samsung S23 Ultra)

deckerst commented 6 days ago

These apps probably don't declare being able to handle that intent.

Sometimes it's on purpose, so that they can control who/how their editor is used. For example Samsung Gallery editors are great but they can only be used by Samsung apps.

Sometimes it's not on purpose, but the developers just didn't properly write the handled intents in the app manifest. If your app of interest is open-source, you could ask them to fix it.

deckerst commented 5 days ago

Could it be the "intent" is somehow different...? I mean, on my device (Samsung S23 Ultra)

No, these intents are standard Android concepts.

artem-tarasenko commented 5 days ago

I don't have any specific preferred app for that, it's just the Photos is quite limited... I guess I have no choice but to try as many as I can hoping to find something suitable, keeping in mind the only working alternative so far (Photos). This is so troublesome.

Anyways, thank you again for helping me and all the explanations, appreciate it.

deckerst commented 5 days ago

Sometimes there is an alternative to using the "edit" intent: using the "share" intent. It's not as well defined, as receiving apps could do whatever, not only editing.

But I suggest this because of an editing app I like: img.ly. After installing it, if in Aves you press "edit", img.ly is listed among editing apps, but it fails when used that way. However, if you share the video to that app, you can use it for editing.