-
Notifications
You must be signed in to change notification settings - Fork 575
Storage Access Framework
Taner Şener edited this page Dec 30, 2021
·
2 revisions
If you want to use a file selected using Storage Access Framework (SAF)
with FFmpegKit
, you can use the following methods to convert a Uri
to a file path defined with FFmpegKit
's saf:
protocol. That path can be safely used as input or output in FFmpegKit
and FFprobeKit
commands.
Uri uri = intent.getData();
String inputPath = FFmpegKitConfig.getSafParameterForRead(requireContext(), uri);
FFmpegKit.execute("-i " + inputPath + " ... output.mp4");
Uri uri = intent.getData();
String outputPath = FFmpegKitConfig.getSafParameterForWrite(requireContext(), uri);
FFmpegKit.execute("-i input.mp4 ... " + outputPath);
Uri uri = intent.getData();
String path = FFmpegKitConfig.getSafParameter(requireContext(), uri, "rw");
FFmpegKit.execute("-i input.mp4 ... " + path);
Copyright (c) 2021-2024 FFmpegKit
- Status
- Versions
- Changelog
- Project Layout
- API
- Using
- Building
- External Libraries
- Patents
- License