class_docstr: `FeatureConnector` for videos, encoding frames individually on disk.
  
  Video: The image connector accepts as input a 4 dimensional `tf.uint8` array
  representing a video, a sequence of paths to encoded frames, or a path or a
  file object that can be decoded with ffmpeg. Note that not all formats in
  ffmpeg support reading from pipes, so providing a file object might fail.
  Furthermore, if a path is given that is not on the local file system, we first
  copy it to a temporary local file before passing it to ffmpeg.
  
  Output:
    video: tf.Tensor of type `tf.uint8` and shape
      [num_frames, height, width, channels], where channels must be 1 or 3
  
  Example:
  
    * In the DatasetInfo object:
  
    ```
    features=features.FeatureDict({
        'video': features.Video(shape=(None, 64, 64, 3)),
    })
    ```
  
    * During generation, you can use any of:
  
    ```
    yield {
        'video': np.ones(shape=(128, 64, 64, 3), dtype=np.uint8),
    }
    ```
  
    or list of frames:
  
    ```
    yield {
        'video': ['path/to/frame001.png', 'path/to/frame002.png'],
    }
    ```
  
    or path to video (including `os.PathLike` objects):
  
    ```
    yield {
        'video': '/path/to/video.avi',
    }
    ```
  
    or file object (or `bytes`):
  
    ```
    yield {
        'video': tf.io.gfile.GFile('/complex/path/video.avi'),
    }
    ```
class_docstr_tok: ["`","FeatureConnector","`","for","videos",",","encoding","frames","individually","on","disk",".","Video",":","The","image","connector","accepts","as","input","a","4","dimensional","`","tf.uint8","`","array","representing","a","video",",","a","sequence","of","paths","to","encoded","frames",",","or","a","path","or","a","file","object","that","can","be","decoded","with","ffmpeg",".","Note","that","not","all","formats","in","ffmpeg","support","reading","from","pipes",",","so","providing","a","file","object","might","fail",".","Furthermore",",","if","a","path","is","given","that","is","not","on","the","local","file","system",",","we","first","copy","it","to","a","temporary","local","file","before","passing","it","to","ffmpeg",".","Output",":","video",":","tf.Tensor","of","type","`","tf.uint8","`","and","shape","[","num_frames",",","height",",","width",",","channels","]",",","where","channels","must","be","1","or","3","Example",":","*","In","the","DatasetInfo","object",":","``","`","features=features.FeatureDict","(","{","'video","'",":","features.Video","(","shape=","(","None",",","64",",","64",",","3",")",")",",","}",")","``","`","*","During","generation",",","you","can","use","any","of",":","``","`","yield","{","'video","'",":","np.ones","(","shape=","(","128",",","64",",","64",",","3",")",",","dtype=np.uint8",")",",","}","``","`","or","list","of","frames",":","``","`","yield","{","'video","'",":","[","'path\/to\/frame001.png","'",",","'path\/to\/frame002.png","'","]",",","}","``","`","or","path","to","video","(","including","`","os.PathLike","`","objects",")",":","``","`","yield","{","'video","'",":","'\/path\/to\/video.avi","'",",","}","``","`","or","file","object","(","or","`","bytes","`",")",":","``","`","yield","{","'video","'",":","tf.io.gfile.GFile","(","'\/complex\/path\/video.avi","'",")",",","}","``","`"]
code: def to_json_content(
      self,
  ) -> (
      feature_pb2.VideoFeature
  ):  # pytype: disable=signature-mismatch  # overriding-return-type-checks
      return feature_pb2.VideoFeature(
          shape=feature_lib.to_shape_proto(self.shape),
          dtype=feature_lib.dtype_to_str(self.dtype),
          encoding_format=self._encoding_format,
          use_colormap=self._use_colormap,
          ffmpeg_extra_args=self._extra_ffmpeg_args,
      )
  
imports: from __future__ import annotations
  import os
  import tempfile
  from typing import Optional, Sequence, Union
  from etils import epath
  import numpy
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.features import image_feature
  from tensorflow_datasets.core.features import sequence_feature
  from tensorflow_datasets.core.proto import feature_pb2
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 5 for calling the Video obj's underlying member method code with example usage: obj.to_json_content() and returns: feature_pb2