Android 10+ 中的存储权限被拒绝

问题描述 投票:0回答:0

我不能在这些高安卓版本中请求存储权限。

我想使用 FFmpeg 镜像视频,但目标文件的权限被拒绝

这是我的代码:

        if (source_url != null && !source_url.equals("")) {
        String source_url1 = source_url.substring(0, source_url.lastIndexOf("/")) + "/'" +
                source_url.substring(source_url.lastIndexOf("/") + 1) + "'";
        String dest_url = "/storage/emulated/0/Pictures/CameraX-Video/Test.mp4";
        String exe = " -y -i " + source_url1 + " -qscale 5 -vf hflip " + dest_url;
        long exe_id = FFmpeg.executeAsync(exe, (executionId, returnCode) -> {
            if (returnCode == RETURN_CODE_SUCCESS) {
                Log.e("FFmpeg", "Success!");
                openCapturePhotoActivityWithResult(video_uri.toString());
            } else {
                Log.e("FFmpeg", "Failed");
            }
        });
    }

android android-permissions android-ffmpeg
© www.soinside.com 2019 - 2024. All rights reserved.