Hi there,
I’ve been playing with the MJPEG example in the IDE and trying shrink the size of the videos by modifying resolution, pixel format, and compression. I’m seeing some odd results - with several videos of the same scene for the same duration, I observe the following file sizes:
320_120_GRAY.mjpeg = 1.1M
320_120_RGB.mjpeg = 830K
20_120_RGB_COMP25.mjpeg = 1.1M
320_120_RGB_COMP50.mjpeg = 1.5M
320_120_RGB_COMP75.mjpeg = 1.9M
So as I increase compression quality, the size increases - this makes sense. However, I would expect grayscale to be half the size of RGB and compression to be at least a bit smaller than uncompressed.
Any ideas? Am I misunderstanding something or using the compression API incorrectly?
m = mjpeg.Mjpeg(name)
startTime = time.ticks()
while (time.ticks() - startTime) < EndTime:
clock.tick()
img = sensor.snapshot()
img.compress(quality=75)
m.add_frame(img)
m.close(clock.fps())
Thanks in advance for the help!
-Ben