def start_scan(self, device: str = ''):
        """
        Scans a QR code from the given camera device.
        If no QR code is found the returned string will be empty.
        If the camera is not found or can't be opened NoCamerasFound will be raised.
        """

        self.validator = QrReaderValidatorCounted()

        device_info = None

        for camera in QMediaDevices.videoInputs():
            if get_camera_path(camera) == device:
                device_info = camera
                break

        if not device_info:
            self.logger.info('Failed to open selected camera, trying to use default camera')
            device_info = QMediaDevices.defaultVideoInput()

        if not device_info or device_info.isNull():
            raise NoCamerasFound(_("Cannot start QR scanner, no usable camera found."))

        self._init_stats()
        self.qrreader_res = []
        self.validator_res = None
        self._ok_done = False
        self._error_message = None

        if self.camera:
            self.logger.info("Warning: start_scan already called for this instance.")

        self.camera = QCamera(device_info)
        self.camera.start()
        self.camera.errorOccurred.connect(self._on_camera_error)  # log the errors we get, if any, for debugging

        self.media_capture_session = QMediaCaptureSession()
        self.media_capture_session.setCamera(self.camera)
        self.media_capture_session.setVideoSink(self.video_surface)

        self.open()

        Scans a QR code from the given camera device.
        If no QR code is found the returned string will be empty.
        If the camera is not found or can't be opened NoCamerasFound will be raised.
        
electrum/gui/qt/qrreader/qtmultimedia/camera_dialog.py