-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scoped Storage #34
Comments
This must be investigated. What are the logs, console output and logcat, saying? |
Hi , String videoPath = FFmpegKitConfig.getSafParameterForWrite(context, inputUri); Whenever I start executeAsync , session gives me the following error I have enabled logging for FFmpegkit but app never seems to goes in to log callabck Here's my executeAsync call FFmpegKit.executeAsync(command, session -> { |
Which callback do you mean, the global one or session specific one? I see a There is a problem about your SAF url |
When I try to get uri from gallery files - I get the following error ERROR: android.app.RecoverableSecurityException: com.sample.app has no access to content://media/external/video/media/287669 SAF_PATH : saf:-1/VID_20200305_222658_HSR_120~2.mp4 Logs shared in previous comment is for gallery pick video But If I try to record video and save file into application level file directory and then ffmpegkit I get the following error Error : saf:125/output2.mp4: Operation not permitted Logs If possible can you share any sample targeting sdk 30 |
I'm facing a similar problem: First I create a new MediaStore entry with The ffmpeg command gives the error: The file was created, but has 0 Bytes. |
@Nitish-29 There are several exceptions/errors in your logs. I'm not sure whether you're doing something allowed by Android. Please see Android storage use cases and best practices guide and validate that you're not trying something prohibited by Android.
ffmpeg-kit-test project includes test applications that use SAF feature and target API Level 30. You can see how SAF is used there. @blue-peacock I'm not good at guessing what is wrong by looking at a few log lines. I suggest creating another issue and filling out issue template fields. |
Yes, I also face the same issue. I am working on Android 10. I get a file uri from a video from the integrated video recorder, then I can't paste it into ffmpeg due to the same error. |
OK, so I got past the issue. This is my first android app. But basically, with newer android versions, storage access is harder due to security reasons/measures. What works for me is only tested on android 10, so it might not work on other versions. I want to pass a video as an input for ffmpeg: either a file or record directly a video from the camera recorder. The camera recorder directly returns a working uri. While to get a uri for a given file, look here https://developer.android.com/training/data-storage/shared/documents-files#java , under "open a file". So now that you have a valid uri, you simply pass it to FFmpegKitConfig.getSafParameterForRead . Make sure that you use this method when reading a file. You need a different one FFmpegKitConfig.getSafParameterForWrite to write a file (output ffmpeg file). It was a dumb oversight, but there are two methods, one for reading and the other one for writing. Make sure that you use the right one based on whether you are using it for the ffmpeg input or output file. The two methods should work fine with a normal android uri |
I believe that's what is happening to @Nitish-29. @tanersener could I ask you to change the wiki to reflect the difference? |
@a-huk , thanks , yes was the same error. |
Current behavior :
Now I am using ffmpegkit 4.4 for testing purpose and the command is
String videoPath = FFmpegKitConfig.getSafParameterForWrite(context, inputUri);
String cmd = "-ss " + start + " -t " + duration + " -accurate_seek" + " -i " + videoPath + " -codec copy -avoid_negative_ts 1 " + outputFile;
While executing the command , session is giving me the protocol not found error. (saf:-1/VID_20210423_053509.mp4: Protocol not found)
Can you help to identify the issue.
Please note : My app targets sdk 30 and have requestLegacyExternalStorage = false
The text was updated successfully, but these errors were encountered: