Skip to content

Modification of setFormat for VideoInputFrameGrabber - #2107

Open
Zjaun wants to merge 2 commits into
bytedeco:masterfrom
Zjaun:VideoInputEnhancement
Open

Modification of setFormat for VideoInputFrameGrabber#2107
Zjaun wants to merge 2 commits into
bytedeco:masterfrom
Zjaun:VideoInputEnhancement

Conversation

@Zjaun

@Zjaun Zjaun commented Oct 3, 2023

Copy link
Copy Markdown

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

saudet commented Oct 3, 2023

Copy link
Copy Markdown
Member

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

@Zjaun

Zjaun commented Oct 3, 2023

Copy link
Copy Markdown
Author

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

saudet commented Oct 3, 2023 via email

Copy link
Copy Markdown
Member

@saudet

saudet commented Oct 3, 2023

Copy link
Copy Markdown
Member

It's in the FrameGrabber class.

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

@Zjaun

Zjaun commented Oct 4, 2023

Copy link
Copy Markdown
Author

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

saudet commented Oct 4, 2023

Copy link
Copy Markdown
Member

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