Xuggler and playing from live stream

自古美人都是妖i 提交于 2019-12-04 11:11:35

Oke we solved the problem:

First we make a TCP connection to the drone:

try
    {
        socket_video_tcp = new Socket();
        socket_video_tcp.connect(new InetSocketAddress(commandSender.droneInetAddress, commandSender.VIDEO_PORT));
    }

Our class is Runnable what means that we also have a method run() In this method we send a video_enable command and we also disable the dynamic video bitrate by sending this command: video:bitrate_ctrl_mode 0;

public void run()
{
    commandSender.sendConfigCommand("VIDEO_ENABLE");
    commandSender.sendConfigCommand("VIDEOBITRATE");

    decode();
}

Our decode() method can be found here: https://github.com/xuggle/xuggle-xuggler/blob/master/src/com/xuggle/xuggler/demos/DecodeAndPlayVideo.java

In this decode method we have changed this:

 if (container.open(filename, IContainer.Type.READ, null) < 0)

To this:

if (container.open(socket_video_tcp.getInputStream(), null) < 0)

That's all!!

Copied from Edit in question:

Today we solved this problem. We tried before to load the socket connection into the Icontainer.open with socketconnection.getInputStream . The result was 0 streams. After some small adjustments the result is 1 stream and we can see the live video from the drone on screen!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!