Xuggler and the game from the live stream

We are currently engaged in a project in which we are trying to play a video file in a window from a real stream in Java. We were able to capture a stream through a Socket using InputStreamReader.

The next step is to use an existing library (Xuggler) or code to decode this stream and display the contents (video) in a simple window.

The stream comes from Parrot AR Drone 2.0 at the IP address 192.168.1.1ל555. That we are stuck. The code we are trying to use is an example of DecodeandPlayVideo, found here:

https://github.com/xuggle/xuggle-xuggler/blob/master/src/com/xuggle/xuggler/demos/DecodeAndPlayVideo.java

It should now be possible to use this with the input stream, but it should, of course, be in the correct format. Is there any way to help us do this?

+4
source share
2 answers

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!!

+3
source

Copied from Editable Question:

Today we have solved this problem. We tried connecting to Icontainer.open with socketconnection.getInputStream before loading the socket. The result was 0 threads. After some minor adjustments to the result - 1 stream, and we can see real-time video from the drone on the screen!

0
source

All Articles