From 4e78eac467d92841e25ee0f85159693b1068a823 Mon Sep 17 00:00:00 2001 From: a-huk <56552991+a-huk@users.noreply.github.com> Date: Thu, 6 May 2021 21:50:38 +0200 Subject: [PATCH] Explicit SAF read & write instructions --- android/README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/android/README.md b/android/README.md index 17d8ba4..f5e8e6d 100644 --- a/android/README.md +++ b/android/README.md @@ -220,12 +220,21 @@ All libraries created by `android.sh` can be found under the `prebuilt` director ``` 8. Convert Storage Access Framework (SAF) Uris into paths that can be read or written by `FFmpegKit`. - - ``` - Uri safUri = intent.getData(); - String videoPath = FFmpegKitConfig.getSafParameterForWrite(requireContext(), safUri); - FFmpegKit.execute("-i file1.mp4 -c:v mpeg4 " + videoPath); - ``` + - Reading a file: + + ``` + Uri safUri = intent.getData(); + String inputVideoPath = FFmpegKitConfig.getSafParameterForRead(requireContext(), safUri); + FFmpegKit.execute("-i " + inputVideoPath + " -c:v mpeg4 file2.mp4"); + ``` + + - Writing to a file: + + ``` + Uri safUri = intent.getData(); + String outputVideoPath = FFmpegKitConfig.getSafParameterForWrite(requireContext(), safUri); + FFmpegKit.execute("-i file1.mp4 -c:v mpeg4 " + outputVideoPath); + ``` 9. Get previous `FFmpeg` and `FFprobe` sessions from session history.