Oke we solved the problem:
First we make a TCP connection with drone:
try { socket_video_tcp = new Socket(); socket_video_tcp.connect(new InetSocketAddress(commandSender.droneInetAddress, commandSender.VIDEO_PORT)); }
Our class is Runnable, which means that we also have a run () method. In this method, we send the video_enable command and 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 decoding method, we changed this:
if (container.open(filename, IContainer.Type.READ, null) < 0)
For this:
if (container.open(socket_video_tcp.getInputStream(), null) < 0)
What all!!
source share