Tip: how to share any video on a Jitsi session

It’s possible to share a Youtube video on Jitsi but if you want to share a video from another source…?

I have tried some tricks on my Debian Buster client and I can stream a high quality video/audio to a Jitsi room. It’s possible to use an MP4 file or a stream from an IP camera or an RTMP/RTSP stream or data from a video/audio capture card as a source.

These are the steps in summary:

  • create a virtual camera
  • create a virtual microphone
  • send the video data to the virtual camera and the audio data to the virtual microphone while playing the video using ffmpeg
  • open chromium, join a Jitsi room, select the virtual camera and the virtual microphone


Install the following packages as root

apt-get install v4l2loopback-dkms ffmpeg


Load the following modules as root

modprobe v4l2loopback video_nr=100 card_label=virtualcam-100 exclusive_caps=1
modprobe snd-aloop id=aloop100

Use the following command to check the result. The output can be a bit different in your case.

ls /dev/video*
>>> /dev/video0  /dev/video1  /dev/video100

ls /proc/asound
>>> aloop100  card0  card1  cards ...

virtual microphone

Switch to your desktop user account, you don’t need to be root from now on.

First, find your snd_aloop input device name

pactl list sources short | grep alsa_input | grep snd_aloop | awk '{print $2}'
>>> alsa_input.platform-snd_aloop.0.analog-stereo

And create a virtual microphone using this device name.

pacmd load-module module-remap-source source_name=mic100 master=alsa_input.platform-snd_aloop.0.analog-stereo source_properties=device.description=mic100 channels=2

Check your source list again, there should be a new device named as mic100

pactl list sources short
>>> ...
>>> 4    mic100  module-remap-source.c   s16le 2ch 44100Hz       RUNNING

virtual camera

No need to do anything for the virtual camera. It’s created when loading the v4l2loopback module.


It’s possible to use any source as long as ffmpeg supports it. I will use an MP4 file in my example. The order of the video/audio channels may be different for some sources. Change the map parameters if this is the case

ffmpeg -re -i parabellum.mp4 -map 0:0 -f v4l2 -c:v rawvideo /dev/video100 -map 0:1 -f alsa hw:aloop100,1

stream to the Jitsi room

Open chromium or chrome and join a Jitsi room. Disable the audio processing because the audio will be clean most probably. The link will be something like that:


Choose the virtual camera (virtualcam-100) and the virtual microphone (mic100). Join the same room using a second tab to see the result. Don’t select the virtual devices on the second tab.


If you made something wrong and want to reset the sound devices

pulseaudio -k

And restart chromium

MUCH too complicated. In ZOOM, I click 2, maybe 3 buttons. In Jitsi there needs to be a better way!

what are the steps for the docker ? in order to achieve any video sharing instead of only youtube video’s

This are for the client’s desktop. Not related to Docker

This works well, however I had to make the /dev/video100 rw for everyone first, otherwise chrome wouldn’t find it and vlc wouldn’t play it. Edit: Seems to work fine without chmod but might need a relog after creating the video device for chrome to see it.

The quality is sadly not as good as the original source (movie file) and the screen proportions are slightly off. Quite the egg heads now :smiley:

The quality depends on the ffmpeg params and the network capacity

Is there a way to do this with a bot / code (no need to manually open the browser)?

Also, I assume the follow me option needs to be enabled so everybody would see the shared content. Is there a way to enable follow me for the bot, by default?

@_samueldmq I am also trying to achieve this. Currently looking into achieving that with puppeteer combined with the method for virtual webcam in this thread. I will keep you posted if I make some progress and would appreciate if you could do the same. Thanks!

Update to the above: I have a working system using Puppeteer and a little express server API so you can control it. I couldn’t get virtual webcam working on my VM so I ended up using flags to use the fake webcam testing features of Chromium to get it working. The videos have to be encoded first into a .y4m format using ffmpeg (a process which has it’s own quirks).

I am still deep in that project now but I will happily document the steps required and release the code once I have a bit more time. If anyone is desparate for the info in the mean time let me know.

1 Like

I would love to join the efforts on this :slightly_smiling_face:

is there a way to share a video stream from an android smartphone?

hi L-Wo, this is amazing, would you be willing to share the code??

Hi all,

I ended up using the code on a very specific client project, so I’m not allowed (yet!) to open-source my work on it.

I used puppeteer to join calls, and the --use-file-for-fake-video-capture and --use-file-for-fake-audio-capture arguments to pass in video/audio file, using ffmpeg to convert the files into the required WAV and Y4M format. My use case required many videos to be played in many conferences at once, for between 1-10 mins. I have a system for organising and scaling these “puppets” which I won’t go into, I’ll give you the information for the core part which allows you to join a call and play a video.

I ended up using this at quite a low resolution - it coped OK with higher resolutions but I needed to play many videos into many conferences from one server in my use case so I had to keep things efficient.

I have uploaded a very basic version here: GitHub - L-wo/jitsi-puppeteer-basic: A basic version of my Jitsi Puppeteer implementation

Most of the inspiration for that comes from Streaming a webcam to a Jitsi Meet room · GitHub

It’s all very untested and I expect it will throw errors for you but hopefully a good starting point if you are exploring this!