I'm using FFMPEG on Android to change bitrate etc of videos that weren't recorded within my app.
The problem I'm facing is that I can't get the absolute path for a video the user selects from the SD Card.
I'm using the Android Storage Access Framework and currently get the following Uri:
content://com.android.externalstorage.documents/document/9C33-6BBD%3AVideos%2Freaps-driving.mp4
The FFMPEG command I use:
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String[] cmd = {"-y", "-i", mVideoUri.toString(), "-c:v", "libx264", "-preset", "ultrafast", "-strict", "-2", "-s", optimalVideoSize, "-aspect", "16:9", "-b", bitrate, String.format("/storage/emulated/0/Movies/InstaVid/VID_INSTAVID%s.mp4", timeStamp)};
executeFFmpegBinary(cmd, timeStamp);
It doesn't matter if I use mVideoUri.toString()
or mVideoUri.getPath()
.
Is there any way I can get the absolute path?