I have a video, and I need to get some of its frames.
I used to do the following: Create a standart bitmap with the size of the video in question, create a canvas and set it to draw on a bitmap.
I use a SurfaceView and a surfaceHolder. A mediaPlayer is drawing on the surfaceView, and I have a method that calls surfaceView.draw(canvas), which draws on the canvas, which draws to the bitmap, which I eventually take and use...
My problem is that 60% of the time I get black frames. The mediaplayer plays its content in a separete thread, and I do not know when the video has started, and when - not, so I believe this is what is getting my black screens.
I need a workaround, a fix, or another method to get the video frame.
Thanks in advance.