How to set source as IP camera input in android webrtc client

1,491 views
Skip to first unread message

Gaurav Joshi

unread,
Jul 27, 2016, 9:20:57 AM7/27/16
to discuss-webrtc
I am trying to use webrtc native on beaglebone black running on Android 4.4. I downloaded webrtc code from https://webrtc.org/native-code/android/ and compiled it for android as per instructions given on this link. Then, I compile APPRTC demo example, this demo example works well on two android mobile phones as it detects mobile phone cameras, when I install this app on Beaglebone black it does not discover any camera (Not even USB web camera). I want to change source of video/audio as IP camera in android app, APPRTC use libjingle_peerconnection.jar file(This file is generated by webrtc from source for android).

I tested APPRTC demo example on a mobile phone, I attached a USB webcam to it thorugh OTG cable,libjingle_peerconnection.jar has a class called as CameraEnumerationAndroid which provides a method

public static int getDeviceCount{
return Camera.getNumberOfCameras();
}
getNumberOfCameras() function calls a native code of Android which only returns count as 2(One for front camera and one for back camera), it does not consider USB webcam as a input source.

Is there any way by which I can always use an IP Camera as video source inside webrtc app? Most of the IP cameras provide RTSP stream as a output. This RTSP Stream I want to use as video source and connect/establish a call using webrtc on my beaglebone Android device without running a separate webrtc server on beaglebone as we have a cloud based webrtc server running already. I have checked Kurento and Janus webrtc gateway servers which can be ported on beaglebone black to read IP camera source and start a webrtc session/call with other clients but I dont want to use a extra server running on beaglebone.

Please help.

Max Lapshin

unread,
Jul 27, 2016, 1:15:27 PM7/27/16
to discuss-webrtc
You will need to write a server or take existing one that repacks video from IP camera to webrtc.

Yes, there is RTP in both cases, but it is small part of all video infrastructure.

Gaurav Joshi

unread,
Jul 30, 2016, 7:15:11 AM7/30/16
to discuss-webrtc
Hello Max,

I don't to run any server on my device, a stream server already runs on a IP Camera which serves this RTSP stream, webrtc on Android uses either front or back camera as a source of input, I want to change to RTSP streaming URL as a source to webrtc client.

Is it possible?

Thanks,
Gaurav

Max Lapshin

unread,
Aug 6, 2016, 2:30:58 AM8/6/16
to discuss-webrtc
No, you need to write somewhere server that will transform one RTP to another.

Either on camera, either on client.

When you way that "webrtc is using local camera", it is a bit other. It is a video sender, it is using local input.
When you say about "using RTSP camera", it means that it is a video receiver.

If you want RTSP camera to be a replacement for your front camera, you will need to hack your webrtc implementation. Edit source of webrtc library.

Gaurav Joshi

unread,
Aug 8, 2016, 3:41:34 AM8/8/16
to discuss-webrtc
Yes, I have already started to look into webrtc source code.

I can see that webrtc library for android is tightly coupled to front or back camera, it might me very tricky to change source of webrtc library for taking RTSP stream from IP camera as a input source and by-pass android hardware cameras.

I will check or think of a different logic.

Thanks for your inputs.

Regards,
Gaurav


Indu Girish

unread,
Jul 13, 2017, 4:23:24 AM7/13/17
to discuss-webrtc
Hi Gaurav,

If you get any solution on this, pls share.

Thanks,
Indu

yasser Syr

unread,
Nov 6, 2017, 2:44:12 AM11/6/17
to discuss-webrtc
I am working on the same area.
Do u get any solution for that?
Thanks

Francesco Sessa

unread,
Mar 1, 2018, 1:51:57 AM3/1/18
to discuss-webrtc
Hi!
I'm working on the same area too.
Any solution?
Thank you!

Naranmandakh Tsogoo

unread,
Jul 26, 2018, 4:21:58 AM7/26/18
to discuss-webrtc
Hi guys
Are there anyone found any solutions
Reply all
Reply to author
Forward
0 new messages