Java – Libstreaming – Uses VLC as the RTSP client

Libstreaming – Uses VLC as the RTSP client… here is a solution to the problem.

Libstreaming – Uses VLC as the RTSP client

I’m trying VLC as an RTSP client. The RTSP server is based on the libstreaming library. I’m using 1rst example provides code:

        // Sets the port of the RTSP server to 1234
        Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
        editor.putString(RtspServer.KEY_PORT, String.valueOf(1234));
        editor.commit();

 Configures the SessionBuilder
        SessionBuilder.getInstance()
        .setSurfaceView(mSurfaceView)
        .setPreviewOrientation(90)
        .setContext(getApplicationContext())
        .setAudioEncoder(SessionBuilder.AUDIO_NONE)
        .setVideoEncoder(SessionBuilder.VIDEO_H264);

 Starts the RTSP server
        this.startService(new Intent(this,RtspServer.class));

Android app launch; I tried to access the flow using VLC (Open Stream) and this URL:

rtsp://192.168.43.250:1234

The device is connected to the same network (I can ping), but nothing happens from the android app and VLC shows the “Connection failed” window.

Any idea what the problem is? Maybe a bad URL, but I can’t find any detailed examples of this.

Solution

It throws a null pointer and checks logcat.

You must provide the URL as rtsp://ip:1234?h264=200-20-320-240

200 – Buffer
20 – frames per second
320 – Resolution w
240 – Resolution h

Related Problems and Solutions