-
Notifications
You must be signed in to change notification settings - Fork 117
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
Cant create thumbnails from the trimmed videos #107
Comments
Hi @slyvelikov , It is not reproducing. I tried to reproduce using below snippet. i take the first frame of the video. public static Bitmap getFrameAt(Activity context, Uri videoUri) {
try {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
retriever.setDataSource(context, videoUri);
Bitmap res= retriever.getFrameAtTime(0);
retriever.release();
return res;
} catch (Exception e) {
e.printStackTrace();
}
return null;
} and i pass try above snippet. |
Hi @a914-gowtham and thank you for your quick response ! Im able to load videos with your library and trimming them, the issue comes after I stitch the 2 videos. So I have an app that allows the customers to "stitch" 2 videos. This is done when you record a video with a pause then Im making small chunks of videos out of these pauses. And after I trim one of the these chunks and then stitch it together with the other video parts and I cant get the thumbnail. Ive tried your snippet but it didnt work. Could this be because of a codec issues between your library and my stitching function ? |
@slyvelikov are you using ffmpeg for stitching. if yes, you could check if both trimmer library and stitch functuon uses same version of ffmpeg. |
Unfortunately, no, Im using file appending to "stick" them together. |
could you share the sample code to append videos. @slyvelikov |
// Log.d(TAG, "Invoking service to append " + fileToAppend.getName() + " to " + mBaseFile.getName()); |
I think the trimmed videos have been corrupted or MediaMetadataRetriever is perceiving them as corrupted. |
I'm not sure if we can join two videos by file appending. but, merging two videos using ffmpeg will defenitely work. |
Hi ya ! As you can see from the title Im trying to create a thumbnail using MediaMetadataRetriever and the method .setDataSource(), but Im getting this error in my logcat and no thumbnail visually - getFrameAtTime: videoFrame is a NULL pointer. If I dont trim the video everything works fine. Also Im stitching 2 videos and Im trimming either of them. But if the videos arent trimmed it can make a thumbnail.
The text was updated successfully, but these errors were encountered: