M.U
M.U

Reputation: 401

streaming video from android camera to pc?

What is the best (performance wise) way to get and stream a video from an android device's camera to a PC?

I have seen this question asked here before and there exist a few open source programs that do just that, but there exist multiple ways from which I don't know which one is the best! for example:

  1. Should the android part be written in c++ or java (performance/api wise)?
  2. Which api should I use to get the video from camera?
  3. What is the best way to stream the video?

I don't intend to support old android versions (<4.x), so if the best way/api is relatively new it's fine by me.

Upvotes: 2

Views: 1782

Answers (1)

Dimitri Podborski
Dimitri Podborski

Reputation: 3774

I'm not familiar with Android development but I'll try to answer.

I suppose that the actual encoding of the raw image data is probably done on hardware chip (otherwise software encoding would probably kill your battery) and it looks like MediaCodec class is exactly what you need. I suppose you want to implement some kind of live streaming service and the latency is important. If so, then you should stick to UDP based transmission methods. Using RTP protocol or MPEG-TS container format would be the best choice for this purpose. Of course you can also use TCP based methods for streaming like HLS or DASH (both of them use HTTP).

You should also take a look at Table 1 Core media format and codec support:

It tells us for example that using H.264 AVC Encoder supports MPEG-TS container and that HLS version 3 is also supported for Android 4.0 and above.

Upvotes: 1

Related Questions