0

I need to send some video data from a drone's camera to a server and then on to a client web page. I am working on an Android app that interacts with the drone - it successfully gets the drone's camera output and renders it. I already have a Java server (using Java Lightweight HTTP Server) working with the client web page that could be used for this purpose. I have come up with two possible methods:

h264 and Wowza
I have a callback method available from the drone's camera that provides a h264 encoded byte array. This should be streamable via RTP, however I haven't found any Android/Java libraries to support streaming this from the source I have available (libstreaming only supports streaming from the camera afaik). If it is possible to stream the incoming h264 byte arrays to Wowza, I could then figure out how to access Wowza from the client and render the stream. This method would not need to use the existing server.

Sampling Bitmaps - The camera output is rendered onto a Texture View in the Android app. This can be sampled to produce Bitmap images, which could be encoded as Base64 and sent to the server. The server then passes the latest Bitmap onto the client and the client renders the Bitmap using the encoded Base64:

document.getElementById('drone_feed')
            .setAttribute(
                'src', 'data:image/png;base64,' + cameraBase64String
            );

I have successfully implemented the second method - the Texture View is sampled every 100ms and the client fetches the current encoded image from the server every 100ms. Obviously this method gives very poor latency and low FPS, but it does work.

So I have two questions:
1. Is the first method (h264 and Wowza) possible, and if so how do I go about streaming the incoming h264 video buffers to Wowza?
2. If the first method is not possible, can I make the second method more efficient, or is there an alternative method I have not considered?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
DaBigJoe
  • 29
  • 2
  • 6

1 Answers1

0

You can accomplish this using OpenGL with Android GoCoder SDK to grab the frames from the drone and then forward them to Wowza Streaming Engine or Cloud.

Examples can be found here:OpenGL

Enea Dume
  • 3,014
  • 3
  • 21
  • 36
Rose 48
  • 41
  • 4
  • That seems like a possible solution. Could you go into further detail about how to 'grab the frames' from the drone feed? The example you provided samples from a `GLSurfaceView` and not a `TextureView`, although there is a `GLTextureView` implementation available [here](https://gist.github.com/ilya-t/c54bd715edd495c07677). – DaBigJoe Aug 06 '18 at 15:38
  • Hi, since I work at Wowza, I can't promote our services on this forum. You can read our documentation on how to accomplish your goal which is here: https://www.wowza.com/docs/how-to-connect-a-publisher-to-wowza-streaming-engine – Rose 48 Aug 07 '18 at 17:18