How can I set the Surface to display the Video in a Java-Android App?
Currently I do:
mSurfaceHolder = GUIconfig.videoWindow.getHolder();
mLibVLC = LibVLC.getInstance();
mLibVLC.init(GUIconfig.mainWindow);
mLibVLC.useIOMX();
mLibVLC.attachSurface(mSurfaceHolder.getSurface(), new IVideoPlayer() {
@Override
public void setSurfaceSize(int width, int height, int visible_width,
int visible_height, int sar_num, int sar_den) {
}
}, GUIconfig.screenWidth, GUIconfig.screenHeight);
mLibVLC.readMedia("rtsp://129.69.207.174:8554/Stream", false);
mLibVLC.play();
GUIconfig.videoWindow is a SurfaceView
The LogCat displays warnings: yuv_rgb_neon filter: can't get output picture
It plays sound, but I cannot see a video. What am I doing wrong?
You may find the correct way to use LibVLC inside an Activity by reading the video activity code from vlc-android
hth
See this question Integrating videolan in Android for live streaming
you need
mLibVLC.setHardwareAcceleration(LibVLC.HW_ACCELERATION_FULL);
mLibVLC.eventVideoPlayerActivityCreated(true);
LibVLC libVLC = new LibVLC();
MediaPlayer mMediaPlayer = new org.videolan.libvlc.MediaPlayer(libVLC);
VlcVout mVlcVout = mMediaPlayer.getVLCVout();
mVlcVout.setVideoView({**YOUR TEXTUREVIEW**});
mVlcVout.attachViews();
Hope it help
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.