fyhertz / libstreaming

A solution for streaming H.264, H.263, AMR, AAC using RTP on Android
Apache License 2.0
3.45k stars 1.07k forks source link

Any support available with Camera2 API #159

Open anandk032 opened 8 years ago

anandk032 commented 8 years ago

We are working on real time video streaming using Lib streaming library. Lib streaming library supports old Camera api, all is working fine but we required to integrate Camera2 api to Lib streaming library. Some of functionality like video preview display using Camera2 api, we integrated but we need to get video frame data for stream continuously, how to get it? please suggest the way forward.

In Lib streaming library, they used below callback method for frame data for old camera api:

mCamera.setPreviewCallback(new Camera.PreviewCallback() { @Override public void onPreviewFrame(byte[] data, Camera camera) { // here we get frame by frame data } });

hank5000 commented 8 years ago

Hi anandk32,

Maybe you can try to use gles.

anandk032 commented 8 years ago

Thanks for the reply, but can you please elaborate more on this. I didn't catch that how to implement with GLES with Camera2, Can you suggest any example or steps?

Fuzzyma commented 7 years ago

@anandk032 any progress with this issue?

anandk032 commented 7 years ago

yes, we integrate by own with Camera2 api

On Wed, Jun 14, 2017 at 2:17 PM, Ulrich-Matthias Schäfer < notifications@github.com> wrote:

@anandk032 https://github.com/anandk032 any progress with this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fyhertz/libstreaming/issues/159#issuecomment-308365978, or mute the thread https://github.com/notifications/unsubscribe-auth/ANOKJfgSJqyJ0at05U-Cy9EO6LpaU3L5ks5sD54egaJpZM4G3V3M .

Fuzzyma commented 7 years ago

any chance, that you can share the code? I have a similar problem at the moment

anandk032 commented 7 years ago

I will guide you how to integrate it.

RyandHo commented 5 years ago

@anandk032 Hi anandk32,can you please guide me how to integrate the Camera2 ? Thank you

tinselttown commented 5 years ago

@anandk032 @Fuzzyma @RyandHo Hi guys, I too am looking into integrating the library with Camera2. Would anyone be able to share on how you approached the problem? Thank you!

gbenroscience commented 4 years ago

@anandk032 , how did you resolve this issue, please

hq286 commented 1 year ago

You need to use MediaCodec to encode the images from Camera2 yourself and then use one of the packetizers to pack the encoded images and send them out. I made a demo for people who are interested in use libstreaming with Camera2 API. Check out https://github.com/hq286/Camera2RTPStream