ngraziano / SharpRTSP

A RTSP handling library
Other
538 stars 180 forks source link

Android camera server #78

Open annyjasmin39 opened 2 years ago

annyjasmin39 commented 2 years ago

Hi,

I tried to implement this in a android device(Android camera as server). implemented same codes as Cameraserver file. Data is sending and receiving,but we cant see video of camera,just a time stamp and black striped background.

Is it possible to use it in android camera??

annyjasmin39 commented 2 years ago

may be if we can improve the video decoding then it will work

RogerHardiman commented 2 years ago

I have used SharpRTSP on Android and on iOS using the Xamarin/Microsoft C# tools.

On Android and on iOS I had to wrote extra code to use the video encoding APIs of each system - the Media SDK on Android and the VideoToolBox SDK on iOS. This gave me fast encoding with RTSP streaming.

Unfortunately I cannot share the code I wrote to link to the native encoding APIs on Android or iOS as those parts were not open source.

But it is possible to do this.

annyjasmin39 commented 2 years ago

ok,,Thank you for the update...i will look into Media SDK on android ..we are just looking for android at the moment...if we can some more hints..then that will be helpful to us...Thanks

annyjasmin39 commented 2 years ago

Hi, I have written encoder for android...now i am facing problem...linking android camera to bytes... not finding any resources to get bytes from android camera...could you please help

RogerHardiman commented 2 years ago

You'd need to ask (or look for existing answers) on Stack Overflow. But from what I remember, I could open the Android camera and get raw images which I could pass to the Encoder API. But it was a long time ago. So try Stack Overflow for up to date answers

annyjasmin39 commented 2 years ago

ya i tried...all are depreciated..they are collecting data from onpreviewframe in previewcallback...which is depreciated now...is there any provision in recent version to collect raw data from camera

RogerHardiman commented 2 years ago

Hi I remember using OnPreviewFrame. But the last time I wrote code for this was 5 years ago usng the Camera API. I do not know what the new functions but did see there was a Camera2 API now

annyjasmin39 commented 2 years ago

ya you are right...onpreviewframe is working perfectly...but those are not availbale in camera2 api... actually need something to collect byte data from camera ...so that i can stream those using this library