Title: @@weblog
Elphel Development Blog
June 1, 2020 12:39 PM
You have subscribed to these e-mail notices about new posts to the blog.
If you want to change your settings or unsubscribe please visit:

Convert ip cam to web cam in Linux for Jitsi, Zoom, etc.

Basically, one need to direct the ip cam stream (mjpeg or rtsp) to a virtual v4l2 device which acts like a web cam and is automatically picked up by a web browser or a web cam application. This can be easily done by gstreamer or ffmpeg.

Quick setup

Install and create a virtual webcam

~$ sudo apt install v4l2loopback-dkms ~$ sudo modprobe v4l2loopback devices=1

Direct the stream

The options below are for gstreamer/ffmpeg and rtsp/mjpeg streams: gstreamer: # rtsp stream ~$ sudo gst-launch-1.0 rtspsrc location=rtsp:// ! rtpjpegdepay ! jpegdec ! videoconvert ! tee ! v4l2sink device=/dev/video0 sync=false # mjpeg stream ~$ sudo gst-launch-1.0 souphttpsrc is-live=true location= ! jpegdec ! videoconvert ! tee ! v4l2sink device=/dev/video0 ffmpeg: # rtsp stream ~$ sudo ffmpeg -i rtsp:// -fflags nobuffer -pix_fmt yuv420p -f v4l2 /dev/video0 # mjpeg stream ~$ sudo ffmpeg -i -fflags nobuffer -pix_fmt yuv420p -r 30 -f v4l2 /dev/video0


Start a video conference application, select the webcam from the menu (/dev/video0). Test link: meet.jit.si



  • ffmpeg (2.8.15) or gstreamer (1.8.3)
  • IP camera capable of streaming mjpeg or rtsp – in this case it’s Elphel NC393

IP camera setup

  • rtsp stream ports for Elphel NC393 cameras: 554, 556, 558, 560
  • mjpeg stream ports for Elphel NC393 cameras: 2323, 2324, 2325, 2326
  • stream resolution/fps: 1920×1080, 30fps
  • ffmpeg for mjpeg stream – “-r 30” sets fps – the default ffmpeg setting is 25 fps

Useful commands

Print web cam settings: v4l2-ctl -d 0 --all Gstreamer play mjpeg: gst-launch-1.0 souphttpsrc is-live=true location= ! jpegdec ! autovideosink Gstreamer play rtsp: gst-launch-1.0 -v playbin uri=rtsp:// uridecodebin0::source::latency=0 Test stream for web cam: sudo gst-launch-1.0 videotestsrc ! tee ! v4l2sink device=/dev/video0


  • Gstreamer 1.8.3 didn’t work without tees in the pipeline.
  • modprobe v4l2loopback can create multiple devices
Support-list mailing list

Reply via email to