ffmpeg-kit icon indicating copy to clipboard operation
ffmpeg-kit copied to clipboard

SAF file only usable once?

Open Myzel394 opened this issue 2 years ago • 4 comments

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

  1. Get file using SAF
  2. Do a failing FFmpeg conversion
  3. 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

Myzel394 avatar Dec 29 '23 20:12 Myzel394

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.

github-actions[bot] avatar Feb 28 '24 01:02 github-actions[bot]

Naaaw bad stale bot.

Myzel394 avatar Feb 28 '24 08:02 Myzel394

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.

tanersener avatar Apr 14 '24 18:04 tanersener

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.

tanersener avatar Jan 06 '25 18:01 tanersener