MelonBread.dev

MelonBread.dev

found out how to pipe video into a device on linux, time to mess with some work meetings

@Moon teach me. Wise wizard.

@Relected when I actually get it working, it shouldn't be hard.

@Relected lmao it worked I piped anime into my meeting

@Relected https://askubuntu.com/questions/881305/is-there-any-way-ffmpeg-send-video-to-dev-video0-on-ubuntu

sudo apt install v4l2loopback-dkms
sudo modprobe v4l2loopback
ffmpeg -re -i input.mp4 -map 0:v -f v4l2 /dev/video0

update /dev/video* a needed

@Moon bookmarked!

@Relected I don't know if audio works because I disabled audio in ffmpeg stream so it wouldn't be that huge of a disruption

@Moon @Relected OBS has a plugin for this as well to make it a "virtual" webcam. You can do all kinds of crazy shit.
https://github.com/CatxFish/obs-v4l2sink
(even though it is archived it still works like a charm)

@rain @Relected right now I'm trying to figure out how to do the same thing with audio on linux since /dev/video is only the video stream

@Moon

So in theory if you want to pipe just audio you would need to make a “virtual” audio sink (in this case we will call it fake_mic)

pactl load-module module-null-sink sink_name=fake_output sink_properties=device.description=fake_output

Have the audio you want playing in something like VLC and pipe that output to the new audio device via pavucontrol, pasystray, or anything else that can manage PulseAudio.

The reason why I suggest VLC is because VLC lets you set your audio device from there menus directly.

Audio > Audio Devices > fake_output

Then create a input loopback of the fake_output we will call fake_mic

pactl load-module module-remap-source master=fake_output.monitor source_name=fake_mic source_properties=device.description="fake_mic"

Then in your program of choice your should be able to select fake_mic that plays whatever your output to it.

@rain audio and video sync looks like it's gonna be hard because it looks like ffmpeg can only output to one device

@rain I think I can pipe the file into tee and then pipe it to two different ffmpeg processes, one that is writing to /dev/video and the other one to the audio device

@Moon What I would do is still play the media in VLC or whatever, pipe the audio to fake_output then with that OBS plugin add VLC as a window source (you can crop out the VLC borders via the transform options) and connect to your meeting app with the dummy video (whatever is on the OBS layout) set as camera and fake_mic as the input.

I have done this a few times when streaming games over Jitsi and such.

None of this is “clean” from the standpoint of the user but it works more or less.

@Moon OH SHIT, please tell me if you get this working how you think it should. I would love to try this method

@rain there may be sync issues with doing this, we'll see

I'm at work so I shouldn't be messing with this right now but I am

@Moon As am I ac_laughter going over my trials and errors to make sure how I do things is as streamlined as possible. All in the name for a quality joke.
replies
0
announces
0
likes
0