问题
I want to extract one frame from video in my app. The video is chosen from my storage device. After trying to call setDataSource I'm getting an IllegalArgumentException.
Here is the part of my code:
MediaMetadataRetriever med = new MediaMetadataRetriever();
med.setDataSource(imageUri.toString());
A value of imageUri is:
content://com.android.providers.media.documents/document/video%3A59728
Is the path of my video in wrong format? I have also tried to use FFmpegMediaMetadataRetriever.
回答1:
use
med.setDataSource(context, imageUri)
if it does not work use MediaStore and get MediaStore URI
来源:https://stackoverflow.com/questions/60326306/extracting-frame-from-video-from-storage-device-using-mediametadataretriever-i