Take the 2-minute tour ×

Possible Duplicate:
Video Streaming in vlcj

public class VlcTest extends VlcjTest {
    if(args.length != 1) {
      System.out.println("Specify a single MRL to stream");

    NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), "C:\\Program Files\\VideoLAN\\VLC");
    Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);

    String media = args[0];
    String [] options = formatHttpStream("", 5080);


    MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(args);
    HeadlessMediaPlayer mediaPlayer = mediaPlayerFactory.newHeadlessMediaPlayer();
    mediaPlayer.playMedia(media, options);
    // Don't exit

  private static String [] formatHttpStream(String serverAddress, int serverPort) {
    String [] sb={":sout = #duplicate{dst=std{access=http,mux=ts,dst=}}"};
    return sb;

I want to confirm that can this code is able to stream the video from the server to the client side. The flow I am trying to achieve is:

  1. Client sends request to server for stream
  2. Server creates connection to client to send the video in packets based on the clients ip address and port number.
share|improve this question

marked as duplicate by Jarrod Roberson, Brad Larson Jul 6 '12 at 22:32


Didn't you ask this same question yesterday? Video Streaming in vlcj –  jschoen Jul 6 '12 at 21:28

1 Answer 1

No this code will not do what you want all. Please refer to my answer on your previous question for why. Especially the section "Explanation of StreamHttp.java part".

share|improve this answer
