I want to use an IP camera with webrtc. However webrtc seems to support only webcams. So I try to convert the IP camera's stream to a virtual webcam.
I found software like IP Camera Adapter, but they don't work well (2-3 frames per second and delay of 2 seconds) and they work only on Windows, I prefer use Linux (if possible).
I try ffmpeg/avconv:
-firstly, I created a virtual device with v4l2loopback (the command was:
sudo modprobe v4l2loopback). The virtual device is detected and can be feed with a video (.avi) with a command like:
ffmpeg -re -i testsrc.avi -f v4l2 /dev/video1
-the stream from the IP camera is available with:
rtsp://IP/play2.sdp for a Dlink DCS-5222L camera. This stream can be captured by ffmpeg.
My problem is to make the link between these two steps (receive the rstp stream and write it to the virtual webcam). I tried
ffmpeg -re -i rtsp://192.168.1.16/play2.sdp -f video4linux2 -input_format mjpeg -i /dev/video0 but there is an error with v4l2 (v4l2 not found).
Does anyones has an idea how to convert a stream from an IP-camera to a virtual camera?