- Add axis bounds GCode variables ``#<_x_min>``, ``#<_x_max>``, etc.
- Expose ``junction-accel`` planning parameter.
- Fixed problem with manual firmware upload on OSX.
+ - Ignore cameras that do not support MJPEG format video.
## v0.4.12
- Segments straddle arc in linearization.
self.width = args.width
self.height = args.height
self.fps = args.fps
- self.fourcc = string_to_fourcc(args.fourcc)
+ self.fourcc = 'MJPG'
self.max_clients = args.camera_clients
self.overtemp = False
if caps.capabilities & v4l2.V4L2_CAP_VIDEO_CAPTURE == 0:
raise Exception('Video capture not supported.')
- self.log.info('Formats: %s', self.dev.get_formats())
- self.log.info('Sizes: %s', self.dev.get_frame_sizes(self.fourcc))
+ fourcc = string_to_fourcc(self.fourcc)
+ formats = self.dev.get_formats()
+ sizes = self.dev.get_frame_sizes(fourcc)
+
+ self.log.info('Formats: %s', formats)
+ self.log.info('Sizes: %s', sizes)
self.log.info('Audio: %s', self.dev.get_audio())
- self.dev.set_format(self.width, self.height, fourcc = self.fourcc)
+ hasFormat = False
+ for name, description in formats:
+ if name == self.fourcc: hasFormat = True
+
+ if not hasFormat:
+ raise Exception(self.fourcc + ' video format not supported.')
+
+ self.dev.set_format(self.width, self.height, fourcc = fourcc)
self.dev.set_fps(self.fps)
self.dev.create_buffers(4)
self.dev.start()
help = 'Camera height')
parser.add_argument('--fps', default = 15, type = int,
help = 'Camera frames per second')
- parser.add_argument('--fourcc', default = 'MJPG',
- help = 'Camera frame format')
parser.add_argument('--camera-clients', default = 4,
help = 'Maximum simultaneous camera clients')
parser.add_argument('--demo', action = 'store_true',