Playing video files over Jitsi
bruce.nikkel at bfh.ch
bruce.nikkel at bfh.ch
Thu Oct 29 16:30:14 CET 2020
Hi Everybody,
I teach some modules at BFH and play a lot of video files in one class.
Now that we are teaching online (again), I needed a quick hack to play
the video files in reasonable quality over Jitsi to the students (I know
Jitsi can stream from YT, but I don't want that).
Just in case somebody else needs it for teaching or presentations, I
made a little diagram and some tips to explain how I set up the audio
and video loopback to play local video files directly from a Jitsi
client on Linux.
This might work with Zoom and Teams, but I didn't test it.
Regards,
Bruce Nikkel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bfh.science/pipermail/bfh-linux-users/attachments/20201029/9fea9d0a/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jitsi-videos.png
Type: image/png
Size: 46596 bytes
Desc: not available
URL: <http://lists.bfh.science/pipermail/bfh-linux-users/attachments/20201029/9fea9d0a/attachment-0001.png>
-------------- next part --------------
Basically two kernel modules create fake/virtual microphone and webcam devices that jitsi can use. Then ffmpeg plays the video file into to these devices.
Make sure you have the right video device (/dev/video#) created by the v4l2loopback kernel module. Usually its the highest number.
The "exclusive_caps=1" is needed to fool jitsi/chrome to think they have exclusive control (otherwise they may not use the device)
The "hw:VirtualMic,1" might be a different number than one, if you get related errors try changing that to 0 or another number linked to the snd-aloop module.
If you can, install the latest v4l2loopback from the github (https://github.com/umlaeute/v4l2loopback) This is v4l2loopback-dkms-git on Arch Linux.
# the camera only appears in jitsi when a video is playing. You have to play that manually in a separate shell:
$ ffmpeg -re -i vid.mp4 -f alsa hw:VirtualMic,1 -f v4l2 /dev/video2
If you have problems playing some video file formats or codecs, try adding these additional ffmpeg flags:
# blank video screen or trouble decoding ?
-f rawvideo
# error message "cannot set channel count to 1 (Invalid argument)" ?
-ac 2
# error message "sample rate 48000 not available, nearest is 44100" ?
-ar 44100
More information about the bfh-linux-users
mailing list