# Stream Encoding
output_5_fps = cam_color.requestOutput(size=(768, 576), enableUndistortion=False, fps=5, type=dai.ImgFrame.Type.NV12)
node_encoder_stream = self.pipeline.create(dai.node.VideoEncoder).build(output_5_fps, frameRate=2, profile=dai.VideoEncoderProperties.Profile.MJPEG, quality=30)
self.qJpgStream = node_encoder_stream.bitstream.createOutputQueue(blocking=False, maxSize=1)
... later in the code, in the loop ...
if self.qJpgStream.has():
msg: dai.EncodedFrame = self.qJpgStream.get() # this msg comes in at 5 fps
The encoded frames come in at 5 fps although the encoder is set to 2 fps.
RCV2, Python 3.11 on windows, depthai==3.3.0… need anything else?
(the luxonis ai said…)
"Yes, the frame rate parameter is respected by the VideoEncoder node on RVC2 devices when using the MJPEG profile. You can set the frame rate using setDefaultProfilePreset(fps, dai.VideoEncoderProperties.Profile.MJPEG), and the encoder will attempt to encode at the specified frame rate, provided the hardware limitations are not exceeded."
which is not true from my testing. When I change the requestOutput fps to 2, the stream does change to 2 fps. But not the encoder!