我正在编写一个从相机(Live! Cam sync hd creative
)流式传输视频的小型应用程序。我正在使用VLCj
库。
在控制台中出现一段时间
[0494a9bc] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 154 ms ignored)
[0494a9bc] main input error: ES_OUT_RESET_PCR called
应用程序在约2000ms
public class CameraServer {
private MediaPlayerFactory factory;
private HeadlessMediaPlayer mediaPlayer;
private CanvasVideoSurface videoSurface;
public CameraServer(){
factory = new MediaPlayerFactory();
// Create player.
mediaPlayer = factory.newHeadlessMediaPlayer();
}
public void start(){
// Select input device.
String mrl = "dshow://";
// Tweak the options depending on your encoding requirements and audio
String[] options = {":sout=#transcode{vcodec=mp2v,fps=30, width=640, height=640}" + formatHttpStream("127.0.0.1", 5555), "no-sout-audio", "clock-jitter=0"};
mediaPlayer.playMedia(mrl, options);
}
private static String formatHttpStream(String serverAddress, int serverPort) {
StringBuilder sb = new StringBuilder(60);
sb.append(":duplicate{dst=std{access=http,mux=ts,");
sb.append("dst=");
sb.append(serverAddress);
sb.append(':');
sb.append(serverPort);
sb.append("}}");
return sb.toString();
}
}
我已经尝试了不同的选择。什么可能是错的?
修改
只有在Windows上编译时才会发生。在Linux上一切正常但它必须在Windows上运行。