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

Modification of setFormat for VideoInputFrameGrabber #2107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Zjaun
Copy link

@Zjaun Zjaun commented Oct 3, 2023

Since the current implementation of VideoInputFrameGrabber does nothing, I modified the statements inside the start() method of the class. In this change, developers can now set the format/subtype of that FrameGrabber. They can now use MJPEG instead of the default media format.

PS: Tried setting the grabber's resolution to 1080p with MJPEG, and the image is black. It's not black if the resolution is lower than that (only happens if you called the grab() method for the first time, the image isn't black after that)

@saudet
Copy link
Member

saudet commented Oct 3, 2023

The values of that look more like video codecs, so we could maybe pick the value from videoCodec instead?

@Zjaun
Copy link
Author

Zjaun commented Oct 3, 2023

I based my changes only in videoInputLib.java (link), can you guide me where is the videoCodec located so that I can take a look?

@saudet
Copy link
Member

saudet commented Oct 3, 2023 via email

@saudet
Copy link
Member

saudet commented Oct 3, 2023

It's in the FrameGrabber class.

So that you could call videoInputGrabber.setVideoCodec(VI_MEDIASUBTYPE_MJPG) to do what you need. Sounds good?

@Zjaun
Copy link
Author

Zjaun commented Oct 4, 2023

Oohh, a new function (I guess) that is not implemented directly in the VideoInputFrameGrabber. I think I may have to comb through the FrameGrabber class and add the methods not implemented to the VideoInputFrameGrabber. Is the parameter for setVideoCodec the same as setRequestedMediaSubType?

@saudet
Copy link
Member

saudet commented Oct 4, 2023

No need to add new methods, just use the value of the videoCodec field variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants