javacv
javacv copied to clipboard
Modification of setFormat for VideoInputFrameGrabber
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)
The values of that look more like video codecs, so we could maybe pick the value from videoCodec instead?
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?
It's in the FrameGrabber class.
It's in the FrameGrabber class.
So that you could call videoInputGrabber.setVideoCodec(VI_MEDIASUBTYPE_MJPG)
to do what you need. Sounds good?
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
?
No need to add new methods, just use the value of the videoCodec field variable.