2

如何设置 Surface 以在 Java-Android 应用程序中显示视频?

目前我做:

        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 是一个 SurfaceView

LogCat 显示警告:yuv_rgb_neon filter: can't get output picture

它播放声音,但我看不到视频。我究竟做错了什么?

4

3 回答 3

1
LibVLC libVLC = new LibVLC();
MediaPlayer  mMediaPlayer =  new org.videolan.libvlc.MediaPlayer(libVLC);
VlcVout mVlcVout = mMediaPlayer.getVLCVout();
mVlcVout.setVideoView({**YOUR TEXTUREVIEW**});
mVlcVout.attachViews();

希望有帮助

于 2016-08-29T00:07:08.857 回答
0

您可以通过阅读来自 vlc-android的视频活动代码找到在 Activity 中使用 LibVLC 的正确方法

hth

于 2013-09-27T12:54:21.853 回答
0

看到这个问题Integrating videolan in Android for live streaming

你需要

mLibVLC.setHardwareAcceleration(LibVLC.HW_ACCELERATION_FULL);
mLibVLC.eventVideoPlayerActivityCreated(true); 
于 2015-02-10T00:41:49.890 回答