-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unable to open from external storage (as file descriptor)? #4
Comments
Hello @earwole1 , With Android 7 it is forbidden to expose URIs to files in your application with file:// schema. So the In Android 10 the Scoped Storage was introduced and it greatly restricted the access to files outside of your app. Even a native library can't work with FILE* type in such a case. So for now I think that pipe protocol is the only way for FFmpeg to access local files on Android 10. |
@Javernaut Thanks for clarifying. This brings up another question then: why does ffmpeg not always produce all frames request? With the pipe protocol, and the default request of 4 frames, The videos I'm using were acquired by the device. Sample encoding is attached. I'd be happy to close this issue and open another one with additional logging. Ultimately, all I'm interested in is dumping every video frame to the filesystem. Thanks! |
@earwole1 , I have only a part of an answer now. Currently I don't have enough time to dive into this issue as I want to. What I know now:
This is all I have in mind for now. Once I have time, I'll return to this whole thing as it bothers me a lot. |
@Javernaut Again, thanks for the quick reply. I'll keep looking at the issue and if I find a solution I'll submit a PR. |
Thanks @Javernaut code and article(A Story about FFmpeg on Android). |
On Pixel2, I have taken a few short videos. 5-10 seconds each.
Within PathUtil.getPath(), the URI is:
content://com.android.externalstorage.documents/document/primary%3ADCIM%2FCamera%2FVID_20200124_154910.mp4
the check for isExternalStorageDocument(uri) is True and the variable "String[] split" (line ~35) contains:
getPath() then returns: /storage/emulated/0/DCIM/Camera/VID_20200124_154910.mp4
Finally, the C++ code fails within media_file_build():
media_file_builder.cpp:149 invokes onError(jMediaFileBuilder).
So, effectively, every video file I attempt to open uses the pipe interface. I am missing something or is this an issue with the newer (well, new-ish) phones running Android 10?
Thank you for the otherwise awesome repo and the ffmpeg builder.
The text was updated successfully, but these errors were encountered: