Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OBS stream filter with libchafa #94

Open
alavaelian opened this issue Jun 20, 2022 · 4 comments
Open

OBS stream filter with libchafa #94

alavaelian opened this issue Jun 20, 2022 · 4 comments
Labels
feature New feature or request

Comments

@alavaelian
Copy link

it is posible use libchafa to make stream in obs studio ? it would a very good way to make a impresive stream

@hpjansson
Copy link
Owner

Thanks for raising the question.

I don't know how OBS interfaces with OS streams/pipes specifically, but it might be possible. Unfortunately there isn't (yet) a ready-made tool for processing video streams with libchafa, but it wouldn't be hard to write one using e.g. ffmpeg or GStreamer for de/encoding. It's certainly fast enough.

This probably isn't exactly what you want, but there are a few hacky ways to record something from your screen and render it with Chafa:

One is by running an X virtual framebuffer (Xvfb) instance. This would be non-interactive, but I've used it successfully to transform xscreensaver and similar demos. Something like this (with the xscreensaver demos installed):

$ Xvfb :99 -ac -fbdir t -screen 0 1440x900x24 &
$ DISPLAY=:99 lament -root &
$ chafa --watch t/Xvfb_screen0

You could also record a session using any available tool (OBS, the GNOME screen recorder, etc) and use ffmpeg to split up the video file into individual images. XWD or GIF are the fastest options for this. Then use chafa to render the images in order:

$ chafa -d 0.05 --clear image*

I'd gladly hear more about what you'd like to do (Picture-in-picture live streaming? Camera/screen capture -> Chafa -> video stream?). Odds are it'll be supported at some point.

@alavaelian
Copy link
Author

thanks for your answer picture in picture yes but only the web cam, the screen it would be good some times too

@alavaelian
Copy link
Author

and thanks for your answer mate so much apreciated

@hpjansson
Copy link
Owner

It may be necessary to implement a Chafa-specific OBS filter.

Here's some inspiration (for me or whoever wants to do it) for how to do that in C sometime in the future:

@hpjansson hpjansson changed the title streaming with libchafa OBS stream filter with libchafa Jun 22, 2022
@hpjansson hpjansson added the feature New feature or request label Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants