I've been working on an Android application that shows live streaming video via RTSP. Assuming I have a well-functioning RTSP server that passes h264 packets, and to view the stream we should connect to rtsp://1.2.3.4:5555/stream
So I tried to use the native MediaPlayer\VideoView, but no luck (the video was stuck after 2-3 seconds of playback, so I loaded mrmaffen's vlc-android-sdk (can be found here) and used the following code:
ArrayList<String> options = new ArrayList<String>(); options.add("--no-drop-late-frames"); options.add("--no-skip-frames"); options.add("-vvv"); videoVlc = new LibVLC(options); newVideoMediaPlayer = new org.videolan.libvlc.MediaPlayer(videoVlc); final IVLCVout vOut = newVideoMediaPlayer.getVLCVout(); vOut.addCallback(this); vOut.setVideoView(videoView); //videoView is a pre-defined view which is part of the layout vOut.attachViews(); newVideoMediaPlayer.setEventListener(this); Media videoMedia = new Media (videoVlc, Uri.parse(mVideoPath)); newVideoMediaPlayer.setMedia(videoMedia); newVideoMediaPlayer.play();
The problem is that I see a blank screen.
Keep in mind that when I put a RTSP link with audio stream only, it works fine.
Is someone familliar with this sdk and have an idea about this issue? Thanks in advance