Page 1 of 1

JVLC - Problem Stopping RTSP Stream play

Posted: 24 Feb 2009 16:45
by Gangadhar
Dear All,

Im trying to play a different RTSP streams using JVLC periodically.
My main problem is I cant stop playing a stream, once I start playing it.

Code: Select all

public void startFirstPlay() { try { md = new MediaDescriptor(jvlc,"rtsp:172.16.1.163/img/media.sdp"); md.getMediaPlayer().play(); } catch (Exception e) { e.printStackTrace(); } } public void startSecondPlay() { System.out.println("-------------------------List: "+md+" ::: "+md.getMediaPlayer().hasVideoOutput() ); if( md != null ){ System.out.println("--------------Stopping--------------"); md.getMediaPlayer().stop(); md.release(); jvlc.release(); System.out.println("------------------------------"); md=null; jvlc = null; } System.out.println("-------------------------------"+md); System.out.println("-------------------------------"+jvlc); } public static void main( String[] args ) throws Exception { final VLCExample exa = new VLCExample(); exa.startFirstPlay(); Thread.sleep(10000); exa.startSecondPlay(); }
my first method is starting the RTSP stream and the second is trying to stop playing it.
When the play method is called, Im able to see the RTSP PLAY command in logs,
but when stop method is called its not showing RTSP TEARDOWN command.

Please help me to stop playing RTSP stream.


Best regards,
Gangadhar. T