0
Answer

Xamarin Android Spliting Video Frames Return Null Values

Anbu Mani

Anbu Mani

7y
296
1
Hi Friends Am using Below Code for Video to Frame Split up,I took the Video in 5Sec afterthat am converted 90 Frames ,but my out was return after 21st Frames to Null Values only..Please Help me..Thanks to Advance...
 
Android.Net.Uri videoUri = data.Data; 
MediaMetadataRetriever media = new MediaMetadataRetriever();
media
.SetDataSource(this, videoUri);
MediaPlayer mp = MediaPlayer.Create(this, videoUri);
long durata_millisec = mp.Duration; List<Android.Graphics.Bitmap> frames;
frames
= new List<Android.Graphics.Bitmap>();
Bitmap bmFrame;
for
(int i = 47777; i < durata_millisec * 1000; i += 47777)
{
bmFrame
= media.GetFrameAtTime(i, MediaMetadataRetriever.OptionClosestSync);
frames
.Add(bmFrame);
}