I am trying to compress a video that is captured from the camera, but the compressed video cannot be saved in Android version 8.1. The same code is working fine for lower versions.
All the permissions that require READ and WRITE external storage are there.
File videoFile = new File(pathToStoredVideo);
String origin;
origin = videoFile.getAbsolutePath();
compressVideo(origin, origin);
I am trying to save a new file at the same location. This code is working fine with lower version but it is not working in Android version 8.1 and above.
Origin looks like this /storage/emulated/0/DCIM/Camera/VID_20190415_143927.mp4
Error in console- E/tmessages: /storage/emulated/0/DCIM/Camera/VID_20190408_173343395.mp4 (Permission denied) time = 18