class_docstr: Encode and write audio/video streams chunk by chunk
  
  Args:
      dst (str, path-like or file-like object): The destination where the encoded data are written.
          If string-type, it must be a resource indicator that FFmpeg can
          handle. The supported value depends on the FFmpeg found in the system.
  
          If file-like object, it must support `write` method with the signature
          `write(data: bytes) -> int`.
  
          Please refer to the following for the expected signature and behavior of
          `write` method.
  
          - https://docs.python.org/3/library/io.html#io.BufferedIOBase.write
  
      format (str or None, optional):
          Override the output format, or specify the output media device.
          Default: ``None`` (no override nor device output).
  
          This argument serves two different use cases.
  
          1) Override the output format.
             This is useful when writing raw data or in a format different from the extension.
  
          2) Specify the output device.
             This allows to output media streams to hardware devices,
             such as speaker and video screen.
  
          .. note::
  
             This option roughly corresponds to ``-f`` option of ``ffmpeg`` command.
             Please refer to the ffmpeg documentations for possible values.
  
             https://ffmpeg.org/ffmpeg-formats.html#Muxers
  
             Please use :py:func:`~torio.utils.ffmpeg_utils.get_muxers` to list the
             multiplexers available in the current environment.
  
             For device access, the available values vary based on hardware (AV device) and
             software configuration (ffmpeg build).
             Please refer to the ffmpeg documentations for possible values.
  
             https://ffmpeg.org/ffmpeg-devices.html#Output-Devices
  
             Please use :py:func:`~torio.utils.ffmpeg_utils.get_output_devices` to list
             the output devices available in the current environment.
  
      buffer_size (int):
          The internal buffer size in byte. Used only when `dst` is a file-like object.
  
          Default: `4096`.
class_docstr_tok: ["Encode","and","write","audio\/video","streams","chunk","by","chunk","Args",":","dst","(","str",",","path-like","or","file-like","object",")",":","The","destination","where","the","encoded","data","are","written",".","If","string-type",",","it","must","be","a","resource","indicator","that","FFmpeg","can","handle",".","The","supported","value","depends","on","the","FFmpeg","found","in","the","system",".","If","file-like","object",",","it","must","support","`","write","`","method","with","the","signature","`","write","(","data",":","bytes",")","-",">","int","`",".","Please","refer","to","the","following","for","the","expected","signature","and","behavior","of","`","write","`","method",".","-","https",":","\/\/docs.python.org\/3\/library\/io.html","#","io.BufferedIOBase.write","format","(","str","or","None",",","optional",")",":","Override","the","output","format",",","or","specify","the","output","media","device",".","Default",":","``","None","``","(","no","override","nor","device","output",")",".","This","argument","serves","two","different","use","cases",".","1",")","Override","the","output","format",".","This","is","useful","when","writing","raw","data","or","in","a","format","different","from","the","extension",".","2",")","Specify","the","output","device",".","This","allows","to","output","media","streams","to","hardware","devices",",","such","as","speaker","and","video","screen",".","..","note",":",":","This","option","roughly","corresponds","to","``","-f","``","option","of","``","ffmpeg","``","command",".","Please","refer","to","the","ffmpeg","documentations","for","possible","values",".","https",":","\/\/ffmpeg.org\/ffmpeg-formats.html","#","Muxers","Please","use",":","py",":","func",":","`","~torio.utils.ffmpeg_utils.get_muxers","`","to","list","the","multiplexers","available","in","the","current","environment",".","For","device","access",",","the","available","values","vary","based","on","hardware","(","AV","device",")","and","software","configuration","(","ffmpeg","build",")",".","Please","refer","to","the","ffmpeg","documentations","for","possible","values",".","https",":","\/\/ffmpeg.org\/ffmpeg-devices.html","#","Output-Devices","Please","use",":","py",":","func",":","`","~torio.utils.ffmpeg_utils.get_output_devices","`","to","list","the","output","devices","available","in","the","current","environment",".","buffer_size","(","int",")",":","The","internal","buffer","size","in","byte",".","Used","only","when","`","dst","`","is","a","file-like","object",".","Default",":","`","4096","`","."]
docstr: Close the output
  
  :py:class:`StreamingMediaEncoder` is also a context manager and therefore supports the
  ``with`` statement.
  It is recommended to use context manager, as the file is closed automatically
  when exiting from ``with`` clause.
  
  See :py:meth:`StreamingMediaEncoder.open` for more detail.
docstr_tok: ["Close","the","output",":","py",":","class",":","`","StreamingMediaEncoder","`","is","also","a","context","manager","and","therefore","supports","the","``","with","``","statement",".","It","is","recommended","to","use","context","manager",",","as","the","file","is","closed","automatically","when","exiting","from","``","with","``","clause",".","See",":","py",":","meth",":","`","StreamingMediaEncoder.open","`","for","more","detail","."]
code: def close(self):
      """Close the output
  
      :py:class:`StreamingMediaEncoder` is also a context manager and therefore supports the
      ``with`` statement.
      It is recommended to use context manager, as the file is closed automatically
      when exiting from ``with`` clause.
  
      See :py:meth:`StreamingMediaEncoder.open` for more detail.
      """
      if self._is_open:
          self._s.close()
          self._is_open = False
  
imports: from dataclasses import dataclass
  from pathlib import Path
  from typing import BinaryIO, Dict, Optional, Union
  import torch
  import torio
label_desc: Use image node_id 7 for calling the StreamingMediaEncoder obj's underlying member method code with example usage: obj.close() without return types