def capture_sequence(self, outputs, format='jpeg', use_video_port=False, resize=None, splitter_port=0, burst=False, bayer=False, **options):
    "\n        Capture a sequence of consecutive images from the camera.\n\n        This method accepts a sequence or iterator of *outputs* each of which\n        must either be a string specifying a filename for output, or a\n        file-like object with a ``write`` method, or a writeable buffer object.\n        For each item in the sequence or iterator of outputs, the camera\n        captures a single image as fast as it can.\n\n        The *format*, *use_video_port*, *splitter_port*, *resize*, and\n        *options* parameters are the same as in :meth:`capture`, but *format*\n        defaults to ``'jpeg'``.  The format is **not** derived from the\n        filenames in *outputs* by this method.\n\n        If *use_video_port* is ``False`` (the default), the *burst* parameter\n        can be used to make still port captures faster.  Specifically, this\n        prevents the preview from switching resolutions between captures which\n        significantly speeds up consecutive captures from the still port. The\n        downside is that this mode is currently has several bugs; the major\n        issue is that if captures are performed too quickly some frames will\n        come back severely underexposed. It is recommended that users avoid the\n        *burst* parameter unless they absolutely require it and are prepared to\n        work around such issues.\n\n        For example, to capture 3 consecutive images::\n\n            import time\n            import picamera\n            with picamera.PiCamera() as camera:\n                camera.start_preview()\n                time.sleep(2)\n                camera.capture_sequence([\n                    'image1.jpg',\n                    'image2.jpg',\n                    'image3.jpg',\n                    ])\n                camera.stop_preview()\n\n        If you wish to capture a large number of images, a list comprehension\n        or generator expression can be used to construct the list of filenames\n        to use::\n\n            import time\n            import picamera\n            with picamera.PiCamera() as camera:\n                camera.start_preview()\n                time.sleep(2)\n                camera.capture_sequence([\n                    'image%02d.jpg' % i\n                    for i in range(100)\n                    ])\n                camera.stop_preview()\n\n        More complex effects can be obtained by using a generator function to\n        provide the filenames or output objects.\n\n        .. versionchanged:: 1.0\n            The *resize* parameter was added, and raw capture formats can now\n            be specified directly\n\n        .. versionchanged:: 1.3\n            The *splitter_port* parameter was added\n\n        .. versionchanged:: 1.11\n            Support for buffer outputs was added.\n        "
    if use_video_port:
        if burst:
            raise PiCameraValueError('burst is only valid with still port captures')
        if bayer:
            raise PiCameraValueError('bayer is only valid with still port captures')
    with self._encoders_lock:
        (camera_port, output_port) = self._get_ports(use_video_port, splitter_port)
        format = self._get_image_format('', format)
        if use_video_port:
            encoder = self._get_images_encoder(camera_port, output_port, format, resize, **options)
            self._encoders[splitter_port] = encoder
        else:
            encoder = self._get_image_encoder(camera_port, output_port, format, resize, **options)
    try:
        if use_video_port:
            encoder.start(outputs)
            encoder.wait()
        else:
            if burst:
                camera_port.params[mmal.MMAL_PARAMETER_CAMERA_BURST_CAPTURE] = True
            try:
                for output in outputs:
                    if bayer:
                        camera_port.params[mmal.MMAL_PARAMETER_ENABLE_RAW_CAPTURE] = True
                    encoder.start(output)
                    if (not encoder.wait(self.CAPTURE_TIMEOUT)):
                        raise PiCameraRuntimeError('Timed out waiting for capture to end')
            finally:
                if burst:
                    camera_port.params[mmal.MMAL_PARAMETER_CAMERA_BURST_CAPTURE] = False
    finally:
        encoder.close()
        with self._encoders_lock:
            if use_video_port:
                del self._encoders[splitter_port]
Capture a sequence of consecutive images from the camera.

This method accepts a sequence or iterator of *outputs* each of which
must either be a string specifying a filename for output, or a
file-like object with a ``write`` method, or a writeable buffer object.
For each item in the sequence or iterator of outputs, the camera
captures a single image as fast as it can.

The *format*, *use_video_port*, *splitter_port*, *resize*, and
*options* parameters are the same as in :meth:`capture`, but *format*
defaults to ``'jpeg'``.  The format is **not** derived from the
filenames in *outputs* by this method.

If *use_video_port* is ``False`` (the default), the *burst* parameter
can be used to make still port captures faster.  Specifically, this
prevents the preview from switching resolutions between captures which
significantly speeds up consecutive captures from the still port. The
downside is that this mode is currently has several bugs; the major
issue is that if captures are performed too quickly some frames will
come back severely underexposed. It is recommended that users avoid the
*burst* parameter unless they absolutely require it and are prepared to
work around such issues.

For example, to capture 3 consecutive images::

    import time
    import picamera
    with picamera.PiCamera() as camera:
        camera.start_preview()
        time.sleep(2)
        camera.capture_sequence([
            'image1.jpg',
            'image2.jpg',
            'image3.jpg',
            ])
        camera.stop_preview()

If you wish to capture a large number of images, a list comprehension
or generator expression can be used to construct the list of filenames
to use::

    import time
    import picamera
    with picamera.PiCamera() as camera:
        camera.start_preview()
        time.sleep(2)
        camera.capture_sequence([
            'image%02d.jpg' % i
            for i in range(100)
            ])
        camera.stop_preview()

More complex effects can be obtained by using a generator function to
provide the filenames or output objects.

.. versionchanged:: 1.0
    The *resize* parameter was added, and raw capture formats can now
    be specified directly

.. versionchanged:: 1.3
    The *splitter_port* parameter was added

.. versionchanged:: 1.11
    Support for buffer outputs was added.
def capture_sequence(self, outputs, format='jpeg', use_video_port=False, resize=None, splitter_port=0, burst=False, bayer=False, **options):
    "\n        Capture a sequence of consecutive images from the camera.\n\n        This method accepts a sequence or iterator of *outputs* each of which\n        must either be a string specifying a filename for output, or a\n        file-like object with a ``write`` method, or a writeable buffer object.\n        For each item in the sequence or iterator of outputs, the camera\n        captures a single image as fast as it can.\n\n        The *format*, *use_video_port*, *splitter_port*, *resize*, and\n        *options* parameters are the same as in :meth:`capture`, but *format*\n        defaults to ``'jpeg'``.  The format is **not** derived from the\n        filenames in *outputs* by this method.\n\n        If *use_video_port* is ``False`` (the default), the *burst* parameter\n        can be used to make still port captures faster.  Specifically, this\n        prevents the preview from switching resolutions between captures which\n        significantly speeds up consecutive captures from the still port. The\n        downside is that this mode is currently has several bugs; the major\n        issue is that if captures are performed too quickly some frames will\n        come back severely underexposed. It is recommended that users avoid the\n        *burst* parameter unless they absolutely require it and are prepared to\n        work around such issues.\n\n        For example, to capture 3 consecutive images::\n\n            import time\n            import picamera\n            with picamera.PiCamera() as camera:\n                camera.start_preview()\n                time.sleep(2)\n                camera.capture_sequence([\n                    'image1.jpg',\n                    'image2.jpg',\n                    'image3.jpg',\n                    ])\n                camera.stop_preview()\n\n        If you wish to capture a large number of images, a list comprehension\n        or generator expression can be used to construct the list of filenames\n        to use::\n\n            import time\n            import picamera\n            with picamera.PiCamera() as camera:\n                camera.start_preview()\n                time.sleep(2)\n                camera.capture_sequence([\n                    'image%02d.jpg' % i\n                    for i in range(100)\n                    ])\n                camera.stop_preview()\n\n        More complex effects can be obtained by using a generator function to\n        provide the filenames or output objects.\n\n        .. versionchanged:: 1.0\n            The *resize* parameter was added, and raw capture formats can now\n            be specified directly\n\n        .. versionchanged:: 1.3\n            The *splitter_port* parameter was added\n\n        .. versionchanged:: 1.11\n            Support for buffer outputs was added.\n        "
    if use_video_port:
        if burst:
            raise PiCameraValueError('burst is only valid with still port captures')
        if bayer:
            raise PiCameraValueError('bayer is only valid with still port captures')
    with self._encoders_lock:
        (camera_port, output_port) = self._get_ports(use_video_port, splitter_port)
        format = self._get_image_format(, format)
        if use_video_port:
            encoder = self._get_images_encoder(camera_port, output_port, format, resize, **options)
            self._encoders[splitter_port] = encoder
        else:
            encoder = self._get_image_encoder(camera_port, output_port, format, resize, **options)
    try:
        if use_video_port:
            encoder.start(outputs)
            encoder.wait()
        else:
            if burst:
                camera_port.params[mmal.MMAL_PARAMETER_CAMERA_BURST_CAPTURE] = True
            try:
                for output in outputs:
                    if bayer:
                        camera_port.params[mmal.MMAL_PARAMETER_ENABLE_RAW_CAPTURE] = True
                    encoder.start(output)
                    if (not encoder.wait(self.CAPTURE_TIMEOUT)):
                        raise PiCameraRuntimeError('Timed out waiting for capture to end')
            finally:
                if burst:
                    camera_port.params[mmal.MMAL_PARAMETER_CAMERA_BURST_CAPTURE] = False
    finally:
        encoder.close()
        with self._encoders_lock:
            if use_video_port:
                del self._encoders[splitter_port]