SAF file only usable once?
Description
It seems to be as if the SAF file generated using FFmpegKitConfig.getSafParameter can only be used once.
Expected behavior It should be usable more than once - if that's not possible or very hard to implement, please add a note to the wiki. It took me multiple days to figure this out.
Current behavior Only usable once
To Reproduce
- Get file using SAF
- Do a failing FFmpeg conversion
- Try to use it again
Environment
- Platform: Android
- Architecture:
x86_64 - Version:
v5.1 - Source branch:
main - Android Studio version:
2022.3.1 Patch 2
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Naaaw bad stale bot.
Thanks for creating this issue. You're right, SAF protocol urls can be used only once, and we hadn't previously implemented reusability for them since we didn't have a scenario where they needed to be reused. Additionally, cleaning the internal resources was automatically handled with this approach.
I believe this aligns with what most people would expect, so I haven't changed the default behaviour. Instead, I've added a new method on the development branch, FFmpegKitConfig.setSafUrlsReusable(), for developers who want to reuse SAF protocol urls. However, it's important to note that the drawback is that the FFmpegKitConfig.unregisterSafProtocolUrl() method, responsible for cleanup, must be called by developers since the library doesn't know when an SAF url can be unloaded.
We have decided to retire the ffmpeg-kit project and will no longer publish any new releases. Additionally, all previously released ffmpeg-kit binaries will be removed soon.
The fix for this issue has been applied to the development branch. If you need it, you will need to build the fix yourself. Thank you for your understanding and support.