Merge pull request #41 from a-huk/patch-1

Explicit SAF read & write instructions
This commit is contained in:
Taner Şener 2021-05-07 13:26:33 +01:00 committed by GitHub
commit de101cf731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,11 +220,20 @@ 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`.
- Reading a file:
```
Uri safUri = intent.getData();
String videoPath = FFmpegKitConfig.getSafParameterForWrite(requireContext(), safUri);
FFmpegKit.execute("-i file1.mp4 -c:v mpeg4 " + videoPath);
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.