class_docstr: Container for multiple `Scene` objects.
class_docstr_tok: ["Container","for","multiple","`","Scene","`","objects","."]
docstr: Get writers and frames.
  
  Helper function for save_animation.
code: def _get_writers_and_frames(
      self,
      filename,
      datasets,
      fill_value,
      ignore_missing,
      enh_args,
      imio_args,
  ):
      """Get writers and frames.
  
      Helper function for save_animation.
      """
      scene_gen = self._scene_gen
  
      first_scene = self.first_scene
      scenes = iter(self._scene_gen)
      info_scenes = [first_scene]
      if "end_time" in filename:
          # if we need the last scene to generate the filename
          # then compute all the scenes so we can figure it out
          log.debug(
              "Generating scenes to compute end_time for filename"
          )
          scenes = list(scenes)
          info_scenes.append(scenes[-1])
  
      available_ds = [
          first_scene.get(ds) for ds in first_scene.wishlist
      ]
      available_ds = [
          DataID.from_dataarray(ds)
          for ds in available_ds
          if ds is not None
      ]
      dataset_ids = datasets or available_ds
  
      if not dataset_ids:
          raise RuntimeError(
              "No datasets found for saving (resampling may be needed to generate composites)"
          )
  
      writers = {}
      frames = {}
      for dataset_id in dataset_ids:
          if not self.is_generator and not self._all_same_area(
              [dataset_id]
          ):
              raise ValueError(
                  "Sub-scene datasets must all be on the same "
                  "area (see the 'resample' method)."
              )
  
          all_datasets = scene_gen[dataset_id]
          info_datasets = [scn.get(dataset_id) for scn in info_scenes]
          this_fn, shape, this_fill = self._get_animation_info(
              info_datasets, filename, fill_value=fill_value
          )
          data_to_write = self._get_animation_frames(
              all_datasets, shape, this_fill, ignore_missing, enh_args
          )
  
          writer = imageio.get_writer(this_fn, **imio_args)
          frames[dataset_id] = data_to_write
          writers[dataset_id] = writer
      return (writers, frames)
  
imports: from __future__ import annotations
  import copy
  import logging
  import warnings
  from queue import Queue
  from threading import Thread
  from typing import Callable, Collection, Mapping
  import dask.array
  import numpy
  import xarray
  from satpy.dataset import DataID
  from satpy.scene import Scene
  from satpy.writers import get_enhanced_image, split_results
label_desc: Use image node_id 28 for calling the MultiScene obj's underlying member method code with example usage: obj._get_writers_and_frames(filename, datasets, fill_value, ignore_missing, enh_args, imio_args) and returns: writers,  frames