I\'m trying to record video in my application and I\'ve noticed that displaying their duration, I see wrong minutes \\ seconds. This happens on
solved in this way:
MediaPlayer mp = MediaPlayer.create(this, Uri.parse(outputfilename));
int duration = mp.getDuration();
mp.release();
ContentValues values = new ContentValues();
values.put(MediaStore.Video.Media.DATA, outputfilename);
values.put(MediaStore.Video.Media.DATE_TAKEN, dateTaken);
values.put(MediaStore.Video.Media.DURATION, duration);
It was the need to calculate and add the video duration to the MediaStore properties.