Skip to content

Storage Access Framework

ffmpegkit-maintained edited this page Jun 23, 2026 · 1 revision

Storage Access Framework

If a file was selected via Storage Access Framework (SAF), you have a content:// Uri, not a filesystem path — ffmpeg/ffprobe need an actual path. FFmpegKitConfig converts a Uri into a saf:-prefixed path you can use directly as input or output in a command.

Input

Uri uri = intent.getData();
String inputPath = FFmpegKitConfig.getSafParameterForRead(requireContext(), uri);
FFmpegKit.execute("-i " + inputPath + " ... output.mp4");

Output

Uri uri = intent.getData();
String outputPath = FFmpegKitConfig.getSafParameterForWrite(requireContext(), uri);
FFmpegKit.execute("-i input.mp4 ... " + outputPath);

Both input and output

Uri uri = intent.getData();
String path = FFmpegKitConfig.getSafParameter(requireContext(), uri, "rw");
FFmpegKit.execute("-i input.mp4 ... " + path);

The resulting path is only valid for use inside FFmpegKit/FFprobeKit commands — it's not a real filesystem path you can pass to other Android APIs.

Clone this wiki locally