简体   繁体   English

无法使用VLCJ流式传输屏幕

[英]Unable to Stream Screen using VLCJ

I wanted to stream the screen using VLCJ through HTTP. 我想使用VLCJ通过HTTP流式传输屏幕。 I am able to do the video streaming with the webcam but when I tried stream my screen It gives me following output and the application stops: 我可以使用网络摄像头进行视频流传输,但是当我尝试流式传输屏幕时,它将显示以下输出,并且应用程序停止运行:

Java Result: -1073741676 Java结果:-1073741676

This is the code which I am using: 这是我正在使用的代码:

public class StreamHttp extends VlcjTest {
static MediaPlayerFactory mediaPlayerFactory;
    public static void main(String[] args) throws Exception {
        new NativeDiscovery().discover();     

        String options = formatHttpStream("127.0.0.1", 5555);       

        mediaPlayerFactory = new MediaPlayerFactory(args);
        HeadlessMediaPlayer mediaPlayer = mediaPlayerFactory.newHeadlessMediaPlayer();
        mediaPlayer.playMedia("screen://", options);


        Thread.currentThread().join();
    }

    private static String formatHttpStream(String serverAddress, int serverPort) {
        StringBuilder sb = new StringBuilder(60);
        sb.append(":sout=#transcode{vcodec=mp4v,vb=800,scale=0,acodec=mpga,ab=128,channels=2,samplerate=44100}:duplicate{dst=std{access=http,mux=ts,");
        sb.append("dst=");
        sb.append(serverAddress);
        sb.append(':');
        sb.append(serverPort);
        sb.append("}}");
        return sb.toString();
    }
}

Kinldy help!! 请帮忙!!

Okay so after some struggle and searching I found that there was an issue with VLC player 2.2.4 which is the latest release. 好吧,经过一番挣扎和搜索,我发现最新版本的VLC Player 2.2.4存在问题。 I switched to VLC 2.1.3 and everything was perfect. 我切换到VLC 2.1.3,一切都很完美。 Got to know that they are working to fix it. 知道他们正在努力修复它。 So no issue with the code. 因此,代码没有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM