rayburgemeestre / webcam-virtual-background

Linux Virtual Background Webcam
Mozilla Public License 2.0
37 stars 2 forks source link

Custom static backgrounds? #1

Closed hardpenguin closed 1 year ago

hardpenguin commented 1 year ago

Cool project but is there a way to set up a custom background, like point to an image file? Thanks!

ChillAndImprove commented 1 year ago

I have started implementing something, but unfortunately, I don't know in which format the *.ayuv files are, such as the Southpark.ayuv file.

Could you @rayburgemeestre please help me understand the format of the *.ayuv files, specifically the Southpark.ayuv file? It would greatly assist me in further development and proper handling of these files. Thank you!

ffmpeg -i southpark.yuv -input_format yuv420p -video_size 640x480 output.jpeg This does not work

rayburgemeestre commented 1 year ago

Hiya,

Sorry for the slow response, I'm currently not at home, will be back in 1-2 hrs.. I created a "script" for it, but I need to search for it :sweat_smile:

Will post it when I find it!

rayburgemeestre commented 1 year ago

Okay, I found my helper files, I've uploaded them in: https://github.com/rayburgemeestre/webcam-virtual-background/tree/master/tools

I didn't have time to test it yet, but if I'm not mistaken (also re-reading the sources), I used gimp, resized it, then exported as "raw image data" type, then I chose "RGB" (which includes the alpha channel). You end up with some foo.data file.

Then I used this:

g++ rgb_to_ayuv.cpp -o rgb_to_ayuv
./rgb_to_ayuv foo.data foo.ayuv

And hopefully it works :grin:

rayburgemeestre commented 1 year ago

It could be that "AYUV" is not really an existing file format, but I needed an alpha channel with the YUV data, so I might have 'invented' it.. :grimacing:

ChillAndImprove commented 1 year ago

I apologize for the delay; you know how busy things can get.

I have added a new option called "external" to the "set-mode" command, which allows you to set an image as the background, you can find the source code as a pull-request. I hope this meets your requirements @rayburgemeestre . If you encounter any issues, please let me know. Additionally, I am unable to push the image to docker.io; you would need to handle that @rayburgemeestre

rayburgemeestre commented 1 year ago

Hey @ChillAndImprove No need for apologies obviously! I've been very busy myself the past few days. Finally should have some time today :sweat_smile: The changes look pretty awesome from what I saw, thanks a lot for the contribution :pray:

rayburgemeestre commented 1 year ago

P.S. I will update the updated image and release tarball to docker ASAP

rayburgemeestre commented 1 year ago

Thanks again @ChillAndImprove :pray: and @hardpenguin for opening this issue. I finally got to compiling the new version and creating a new docker image.

I'll close this issue. Let me know if I forgot something or if something can be improved then I can re-open or fix it.