0
我的任務是使用網格中的鏈接時間清除器播放多個視頻,並且我已經使其工作(使用VLCJ NOT VLCJ-PRO),但它非常挑剔。VLCJ-Pro Java返回:-57005
所以我決定試試VLCJ-Pro,但是在第一行發現錯誤。
22:25:25.614 [main] INFO u.c.c.vlcj.discovery.NativeDiscovery - Discovery
found libvlc at 'D:\VLC'
C:\Users\trans\AppData\Local\NetBeans\Cache\8.2\executor-
snippets\run.xml:53: Java returned: -57005
BUILD FAILED (total time: 0 seconds)
VLCJ-Pro應該可以幫助解決VLCJ的多視頻問題(原生庫崩潰發生很多)。所以我想我會看看它是否有助於穩定,但我甚至無法讓它運行。
這是我整個的代碼我使用測試庫。我使用Netbeans作爲我的IDE,並在示例代碼中添加了所有JAR庫。
如果您有任何使用VLCJ-Pro的經驗,我將不勝感激任何有關我如何出錯的反饋。
package vlcjprodemo;
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
import uk.co.caprica.vlcj.discovery.NativeDiscovery;
import uk.co.caprica.vlcj.version.LibVlcVersion;
import uk.co.caprica.vlcjpro.client.player.OutOfProcessMediaPlayer;
import uk.co.caprica.vlcjpro.client.player.OutOfProcessMediaPlayerComponent;
import uk.co.caprica.vlcjpro.client.player.OutOfProcessMediaPlayerComponentFactory;
public class VLCJProDemo {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
new NativeDiscovery().discover();
LibVlcVersion.getVersion();
//CRASHES HERE
OutOfProcessMediaPlayerComponentFactory theFactory = new OutOfProcessMediaPlayerComponentFactory();
OutOfProcessMediaPlayerComponent theComponent = theFactory.newOutOfProcessMediaPlayerComponent();
Canvas theVideoCanvas = new Canvas();
theVideoCanvas.setFocusable(true);
theVideoCanvas.setSize(new Dimension(1920, 1080));
theVideoCanvas.setLocation(0, 0);
theComponent.setVideoSurface(theVideoCanvas);
OutOfProcessMediaPlayer theMediaPlayer = theComponent.mediaPlayer();
theMediaPlayer.setRepeat(true);
JFrame mainFrame = new JFrame();
mainFrame.setLayout(new BorderLayout());
mainFrame.setBackground(Color.black);
mainFrame.setMaximumSize(new Dimension(1920, 1080));
mainFrame.setPreferredSize(new Dimension(1920, 1080));
mainFrame.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);
mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
mainFrame.add(theVideoCanvas);
mainFrame.pack();
mainFrame.setVisible(true);
theMediaPlayer.playMedia("horse.avi");
}
}
是的,我恐怕是這樣。 –