Hello all,
I'm facing a problem with the color domain of the RGB camera (Oak-D W Pro with OV9782 as RGB sensor): it's like my video has a red/pink filter.
Below is the recording snippet. After the recording the raw video, I transform the encoded file to .mp4 using:
ffmpeg -framerate 10 -i raw_color.bin -c copy raw_color.mp4
I'm using VLC to replay file.
Do you have an idea?
Thank you!
# Initialize records file
self.videoFileRgb = open('raw_color.bin', 'wb')
self.videoFileLeft = open('raw_left.bin', 'wb')
self.videoFileRight = open('raw_right.bin', 'wb')
self.records_fd = {'rgb': self.videoFileRgb, 'left': self.videoFileLeft, 'right': self.videoFileRight}
# Intilialize, configure and start camera
self.oak = OakCamera()
color = self.oak.create_camera('color', resolution='800p', fps=10, encode=True)
left = self.oak.create_camera('left', resolution='800p', fps=10, encode=True)
right = self.oak.create_camera('right', resolution='800p', fps=10, encode=True)
self.oak.callback(color.out.encoded, callback=lambda x: self.cb_camera(x, 'rgb'))
self.oak.callback(left.out.encoded, callback=lambda x: self.cb_camera(x, 'left'))
self.oak.callback(right.out.encoded, callback=lambda x: self.cb_camera(x, 'right'))
self.oak.start()
# Define calback function (if recording activated, save frame in the coresponding file)
def cb_camera(self, packet: FramePacket, camera_name):
if self.is_recording.value == 1:
fd_camera = self.records_fd[camera_name]
packet.frame.tofile(fd_camera)
# Main loop where "self.is_recording" can be set to record raw frames
while True:
self.oak.poll()