I'm creating video filter for Android app, so I'm using TextureView
to play video and filter on its SurfaceTexture
.
But the FPS of video's always lower than original(30fps).
As I checked on Galaxy S3, onSurfaceTextureUpdated()
only enter 5~8 times per sec although having filter or not. But on stronger device, as Samsung Galaxy J, it could increase to 10~13 times per sec
Note that this video load from SD card.
Does someone know the reason?
mVideoPlayer.reset();
mVideoPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mVideoPlayer.setDataSource(mVideoPath);
mVideoPlayer.setSurface(new Surface(surfaceTexture));
mVideoPlayer.setLooping(true); mVideoPlayer.prepareAsync();
mVideoPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {mp.start(); }
});