Stream Static Image to V4L2Loopback Using Obs with V4L2 Plugin, Ffmpeg or Gstreamer

Stream static image to v4l2loopback using obs with v4l2 plugin, ffmpeg or gstreamer

I just tried it with Android Studio Emulator API 28 (Google X86_ARM) and it works. So it seems that it is related to the CPU Architecture of the emulator and x86 64 does not work. I needed arm though and thankfully Google added Arm translation to an image in Api 28.

It seems that only images with resolution 1920x1080 work, but maybe it is only related to the ratio.

Obs does not work now for some reason but this command works perfectly:
ffmpeg -loop 1 -re -i licensePlate2.png -f v4l2 -vcodec rawvideo -pixfmt nv12 -vf transpose=4 /dev/video2

When using ffmpeg as producer I cannot see v4l2loopback device in chrome

the problem is most likely, that some software (probably including chrome) is a bit picky about the supported colour format.

your ffmpeg command doesn't specify any colour format, so I guess it will take one that is easiest to convert to from the NDI stream. NDI supports a number of different formats (including rather exotic ones like P216) and it might well be that it picks an output format that is not usable by chrome.

otoh, your gstreamer-pipeline uses a very specific format (I420).
try enforcing the same format when using ffmpeg, e.g. using something like -vf format=pix_fmts=yuv420p

see also https://github.com/umlaeute/v4l2loopback/wiki/Colorspace-Issues

v4l2loopback format not support error in OBS Studio

I found it. I forgot to run sudo modprobe v4l2loopback. It enables it I think.

Writing MJPEG to loopback device with FFMPEG fails on Ubuntu 20.04. Works on Rasperry Pi

I was using an outdated version of FFMPEG (4.2.X). I updated to 4.4.1-3 from this PPA and now everything works as expected. I hope this can be of use to someone someday dealing with the same hair-pulling issue.



Related Topics



Leave a reply



Submit