{ String media = "d:\\a.mp4";
String options = formatHttpStream("127.0.0.1", 5555);
System.out.println("Streaming '" + media + "' to '" + options + "'");
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(args[0]);
HeadlessMediaPlayer mediaPlayer = mediaPlayerFactory.newHeadlessMediaPlayer();
mediaPlayer.playMedia(media, options);
Thread.currentThread().join();
}
private static String formatHttpStream(String serverAddress, int serverPort) {
StringBuilder sb = new StringBuilder(60);
sb.append(":sout=#duplicate{dst=std{access=http,mux=ts,");
sb.append("dst=");
sb.append(serverAddress);
sb.append(':');
sb.append(serverPort);
sb.append("}}");
return sb.toString();
}
LOG ERROR:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Streaming 'd:\a.mp4' to ':sout=#duplicate{dst=std{access=http,mux=ts,dst=127.0.0.1:5555}}' Exception in thread "main" java.lang.RuntimeException: Failed to load the native library.
The error was "Unable to load library 'libvlc': JNA native support (win32-amd64/libvlc.dll) not found in resource path (C:\Users\Adam\http\VLC STREAM\bin;E:\Adam\Desktop\vlcj-3.7.0\jna-3.5.2.jar;E:\Adam\Desktop\vlcj-3.7.0\platform-3.5.2.jar;E:\Adam\Desktop\vlcj-3.7.0\slf4j-api-1.7.10.jar;E:\Adam\Desktop\vlcj-3.7.0\vlcj-3.7.0.jar;E:\Adam\Desktop\apache-logging-log4j.jar)".
The required native libraries are named "libvlc.dll" and "libvlccore.dll".
In the text below represents the name of the directory containing "libvlc.dll" and "libvlccore.dll"...
There are a number of different ways to specify where to find the native libraries:
Include NativeLibrary.addSearchPath("libvlc", ""); at the start of your application code.
Include System.setProperty("jna.library.path", ""); at the start of your application code.
Specify -Djna.library.path= on the command-line when starting your application.
Add to the system search path (and reboot).
If this still does not work, then it may be necessary to explicitly add the native library directory to the operating system configuration - e.g. on Linux this might mean setting the LD_LIBRARY_PATH environment variable, or adding configuration to the "/etc/ld.so.conf" file or the "/etc/ld.so.conf.d" directory. Of these options, setting LD_LIBRARY_PATH is the only one that would not require root privileges.
Finally, it is not possible to mix CPU architectures - it is not possible for a 64-bit Java Virtual Machine to load 32-bit native libraries.
More information may be available in the log.
at uk.co.caprica.vlcj.binding.LibVlcFactory.create(LibVlcFactory.java:198)
at uk.co.caprica.vlcj.player.MediaPlayerFactory.<init>(MediaPlayerFactory.java:256)
at StreamHttp.main(StreamHttp.java:11)
LIB:
http://zapodaj.net/ed5de522e2b3e.jpg.html
I have no idea