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

Jpeg support #7

Open
dinther opened this issue Apr 4, 2020 · 7 comments
Open

Jpeg support #7

dinther opened this issue Apr 4, 2020 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@dinther
Copy link

dinther commented Apr 4, 2020

The PNG files look like they are not compressed which is a bit of a bandwidth hog when uploading every few seconds. Jpeg support would be awesome.

@synap5e
Copy link
Owner

synap5e commented Apr 6, 2020

I'd be concerned about the CPU usage of encoding jpegs at a rate that png's are causing bandwidth issues. If you need high frequency images sent over network I feel like a mjpeg stream to a url through a custom ffpmeg output might work better than this plugin.

What is your use case for this in particular?

@dinther
Copy link
Author

dinther commented Apr 6, 2020 via email

@synap5e
Copy link
Owner

synap5e commented Apr 7, 2020

Ah, yeah that makes sense where you need individual sources.

Code wise, JPEG support should (hopefully) be as simple as changing
AV_CODEC_ID_PNG to AV_CODEC_ID_JPEG
https://github.com/synap5e/obs-screenshot-plugin/blob/master/screenshot-filter.c#L452
I can see how well this works when I next go through the code, or you could try it out if you need sooner.

For resizing, I would imagine adding in sws_scale before encoding would be the way to go. Right now the image is a direct dump of the source, so resizing it wouldn't change anything and the only way to change it would be to add a resize filter before this filter in the chain (which would also change the output).

I'm a bit unclear on how your app would use this plugin, would it script OBS to add the filter to each source?

@dinther
Copy link
Author

dinther commented Apr 7, 2020 via email

@synap5e
Copy link
Owner

synap5e commented May 29, 2020

Marking this as help wanted in the meantime. If anyone wishes to experiment with AV_CODEC_ID and/or sws_scale along with the corresponding properties (dropdowns, etc.) I would be happy to help with any issues that are encountered.

@synap5e synap5e added the help wanted Extra attention is needed label May 29, 2020
@iareski
Copy link

iareski commented Aug 13, 2021

Ah, yeah that makes sense where you need individual sources.

Code wise, JPEG support should (hopefully) be as simple as changing
AV_CODEC_ID_PNG to AV_CODEC_ID_JPEG
https://github.com/synap5e/obs-screenshot-plugin/blob/master/screenshot-filter.c#L452
I can see how well this works when I next go through the code, or you could try it out if you need sooner.

For resizing, I would imagine adding in sws_scale before encoding would be the way to go. Right now the image is a direct dump of the source, so resizing it wouldn't change anything and the only way to change it would be to add a resize filter before this filter in the chain (which would also change the output).

I'm a bit unclear on how your app would use this plugin, would it script OBS to add the filter to each source?

Hello friends can u help me with that? I need to a export .jpg instead of .png

@synap5e
Copy link
Owner

synap5e commented Mar 18, 2022

The fork https://github.com/norihiro/obs-screenshot-plugin has this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants