brunoherbelin / vimix

Live Video Mixer
GNU General Public License v3.0
282 stars 27 forks source link

V4L loopback support #71

Closed lupin3rd closed 1 year ago

lupin3rd commented 1 year ago

On connected device source i don't see devices created by v4l loopback: https://github.com/umlaeute/v4l2loopback I use those to write video frame from puredata. Vimix support loopback devices?

brunoherbelin commented 1 year ago

yes, vimix supports v4l2 support.

Don't you have the option in the Display window?

Screenshot from 2023-03-22 23-46-16

NB: this screenshot is from the latest Beta

lupin3rd commented 1 year ago

Yes. I have but i'm talking abount input source of type "connected"... In those i don't have v4l input, but i can see this v4l input with mplayer or vlc. Vimix support v4l only in output?

brunoherbelin commented 1 year ago

Yes, you should have input for connected sources with V4L2 devices :

Screenshot from 2023-03-23 19-07-05

Maybe a gst plugin should be installed :

GStreamer 1.20.03
Plugins & features (runtime) :
> v4l2codecs
> video4linux2
 -   v4l2src
 -   v4l2sink
 -   v4l2radio
 -   v4l2deviceprovider
brunoherbelin commented 1 year ago

aha! I might have understood the problem. Are you compiling vimix Beta by packaging Flatpak ? If so, yes indeed I could replicate that the v4l2 was not embedded in the package. To try if I fixed it, you can rebuild it:

Get the flatpak manifest for vimix:

~$ curl -O https://raw.githubusercontent.com/brunoherbelin/vimix/master/flatpak/io.github.brunoherbelin.Vimix.json

Launch the build of the flatpak:

~$ flatpak-builder --user --install --force-clean build io.github.brunoherbelin.Vimix.json

Otherwise, please indicate the version and packaging / source of your vimix binary.

lupin3rd commented 1 year ago

Hi Bruno, sorry for the delay on reply. I use vimix beta compiled by myself on devuan 4 (debian 11) and i have all gstreamer plugins installed. I create the loopback devices with: sudo modprobe v4l2loopback video_nr=9,10 card_label="puredata loopback","vimix loopback" I use successfull those loopbacks to write output data: in vimix works fine the stream on video10, and in puredata i write with gem object pix_record on video9. I test those with mplayer and i see those two streaming: mplayer tv:// -tv device=/dev/video9

But if i add a vimix source input i don't see V4L: 2023-03-25_09-41

lupin3rd commented 1 year ago

~$ gst-inspect-1.0 --plugin video4linux2: v4l2src: Video (video4linux2) Source video4linux2: v4l2sink: Video (video4linux2) Sink video4linux2: v4l2radio: Radio (video4linux2) Tuner video4linux2: v4l2deviceprovider (GstDeviceProviderFactory) video4linux2: v4l2convert: V4L2 Video Converter

brunoherbelin commented 1 year ago

Ok, so I added a button (arrows in circle) to refresh the list of devices :

Screenshot from 2023-03-26 17-42-40

The list is automatically populated (try to unplug / replug a device to see the list change), but the v4l2 device does not behave like that (no event is sent on creation) ; this might be why you could not find it in the list. (NB: if you create the device before launching vimix, it should see the loopback device)

lupin3rd commented 1 year ago

Hi. Vimix don't see the loopback device. I upload an example... i use /dev/video9 to write frame with puredata.... if i run mplayer i see /dev/video9 stream... then i run vimix (last commit) but i don't see loopback device... how vimix search virtual video devices?? https://youtu.be/jez67UkwcqY

brunoherbelin commented 1 year ago

humm... Could you please try to add exclusive_caps=1,1 to your command line for launching the loopback?

lupin3rd commented 1 year ago

I confirm that with exclusive_caps option all works fine. Then i run: sudo modprobe v4l2loopback video_nr=9,10 card_label="puredata loopback","vimix loopback"