4

I'm developing a video chatting application. I used vlcj for live video streaming, but failed to capture the video from the other system.

public static void main(String[] args) throws Exception 
{
     NativeLibrary.addSearchPath("libvlc", "C:\\Program Files\\VideoLAN\\VLC");

     String media = "dshow://"; 
     String[] options = {" :dshow-vdev=CyberLink Webcam Splitter :dshow-adev=Microphone (Realtek High Defini  :live-caching=300", ":sout = #transcode{vcodec=h264,vb=800,fps=15,scale=1,width=1280,height=800,acodec=mp4a,ab=128,channels=2,samplerate=44100}:http{dst=:8080/a.ogg} :sout-keep"};

     System.out.println("Streaming '" + media + "' to '" + options + "'"); 

     MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(options); 
     HeadlessMediaPlayer mediaPlayer = mediaPlayerFactory.newMediaPlayer(); 
     mediaPlayer.playMedia(media, options);
     new PlayStream().play();

     // Don't exit
     Thread.currentThread().join();
}

This is my code, please help me to overcome the issue.

Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
Raji A C
  • 2,261
  • 4
  • 26
  • 31
  • Changed the streaming string,and i works fineemediaPlayer.playMedia("dshow://", ":sout=#transcode{vcodec=h264,vb=800,fps=15,scale=1,width=1280,height=800,acodec=mp4a,ab=128,channels=2,samplerate=44100}:rtp{sdp=rtsp://@:5555/demo}", ":no-sout-rtp-sap", ":no-sout-standard-sap", ":sout-all", ":sout-keep"); – Raji A C May 28 '12 at 04:14
  • You'd do well to put that as the answer and accept it so that others who run into this can quickly find the solution! – Michael Berry May 28 '12 at 17:06

1 Answers1

1

Changed the streaming string,and i works fine

mediaPlayer.playMedia("dshow://", ":sout=#transcode{vcodec=h264,vb=800,fps=15,scale=1,width=1280,height=800,acod‌​ec=mp4a,ab=128,channels=2,samplerate=44100}:rtp{sdp=rtsp://@:5555/demo}", ":no-sout-rtp-sap", ":no-sout-standard-sap", ":sout-all", ":sout-keep");
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Raji A C
  • 2,261
  • 4
  • 26
  • 31