class_docstr: Fetch and decode audio/video streams chunk by chunk.
  
  For the detailed usage of this class, please refer to the tutorial.
  
  Args:
      src (str, path-like, bytes or file-like object): The media source.
          If string-type, it must be a resource indicator that FFmpeg can
          handle. This includes a file path, URL, device identifier or
          filter expression. The supported value depends on the FFmpeg found
          in the system.
  
          If bytes, it must be an encoded media data in contiguous memory.
  
          If file-like object, it must support `read` method with the signature
          `read(size: int) -> bytes`.
          Additionally, if the file-like object has `seek` method, it uses
          the method when parsing media metadata. This improves the reliability
          of codec detection. The signagure of `seek` method must be
          `seek(offset: int, whence: int) -> int`.
  
          Please refer to the following for the expected signature and behavior
          of `read` and `seek` method.
  
          - https://docs.python.org/3/library/io.html#io.BufferedIOBase.read
          - https://docs.python.org/3/library/io.html#io.IOBase.seek
  
      format (str or None, optional):
          Override the input format, or specify the source sound device.
          Default: ``None`` (no override nor device input).
  
          This argument serves two different usecases.
  
          1) Override the source format.
             This is useful when the input data do not contain a header.
  
          2) Specify the input source device.
             This allows to load media stream from hardware devices,
             such as microphone, camera and screen, or a virtual device.
  
  
          .. note::
  
             This option roughly corresponds to ``-f`` option of ``ffmpeg`` command.
             Please refer to the ffmpeg documentations for the possible values.
  
             https://ffmpeg.org/ffmpeg-formats.html#Demuxers
  
             Please use :py:func:`~torio.utils.ffmpeg_utils.get_demuxers` to list the
             demultiplexers available in the current environment.
  
             For device access, the available values vary based on hardware (AV device) and
             software configuration (ffmpeg build).
  
             https://ffmpeg.org/ffmpeg-devices.html#Input-Devices
  
             Please use :py:func:`~torio.utils.ffmpeg_utils.get_input_devices` to list
             the input devices available in the current environment.
  
      option (dict of str to str, optional):
          Custom option passed when initializing format context (opening source).
  
          You can use this argument to change the input source before it is passed to decoder.
  
          Default: ``None``.
  
      buffer_size (int):
          The internal buffer size in byte. Used only when `src` is file-like object.
  
          Default: `4096`.
class_docstr_tok: ["Fetch","and","decode","audio\/video","streams","chunk","by","chunk",".","For","the","detailed","usage","of","this","class",",","please","refer","to","the","tutorial",".","Args",":","src","(","str",",","path-like",",","bytes","or","file-like","object",")",":","The","media","source",".","If","string-type",",","it","must","be","a","resource","indicator","that","FFmpeg","can","handle",".","This","includes","a","file","path",",","URL",",","device","identifier","or","filter","expression",".","The","supported","value","depends","on","the","FFmpeg","found","in","the","system",".","If","bytes",",","it","must","be","an","encoded","media","data","in","contiguous","memory",".","If","file-like","object",",","it","must","support","`","read","`","method","with","the","signature","`","read","(","size",":","int",")","-",">","bytes","`",".","Additionally",",","if","the","file-like","object","has","`","seek","`","method",",","it","uses","the","method","when","parsing","media","metadata",".","This","improves","the","reliability","of","codec","detection",".","The","signagure","of","`","seek","`","method","must","be","`","seek","(","offset",":","int",",","whence",":","int",")","-",">","int","`",".","Please","refer","to","the","following","for","the","expected","signature","and","behavior","of","`","read","`","and","`","seek","`","method",".","-","https",":","\/\/docs.python.org\/3\/library\/io.html","#","io.BufferedIOBase.read","-","https",":","\/\/docs.python.org\/3\/library\/io.html","#","io.IOBase.seek","format","(","str","or","None",",","optional",")",":","Override","the","input","format",",","or","specify","the","source","sound","device",".","Default",":","``","None","``","(","no","override","nor","device","input",")",".","This","argument","serves","two","different","usecases",".","1",")","Override","the","source","format",".","This","is","useful","when","the","input","data","do","not","contain","a","header",".","2",")","Specify","the","input","source","device",".","This","allows","to","load","media","stream","from","hardware","devices",",","such","as","microphone",",","camera","and","screen",",","or","a","virtual","device",".","..","note",":",":","This","option","roughly","corresponds","to","``","-f","``","option","of","``","ffmpeg","``","command",".","Please","refer","to","the","ffmpeg","documentations","for","the","possible","values",".","https",":","\/\/ffmpeg.org\/ffmpeg-formats.html","#","Demuxers","Please","use",":","py",":","func",":","`","~torio.utils.ffmpeg_utils.get_demuxers","`","to","list","the","demultiplexers","available","in","the","current","environment",".","For","device","access",",","the","available","values","vary","based","on","hardware","(","AV","device",")","and","software","configuration","(","ffmpeg","build",")",".","https",":","\/\/ffmpeg.org\/ffmpeg-devices.html","#","Input-Devices","Please","use",":","py",":","func",":","`","~torio.utils.ffmpeg_utils.get_input_devices","`","to","list","the","input","devices","available","in","the","current","environment",".","option","(","dict","of","str","to","str",",","optional",")",":","Custom","option","passed","when","initializing","format","context","(","opening","source",")",".","You","can","use","this","argument","to","change","the","input","source","before","it","is","passed","to","decoder",".","Default",":","``","None","``",".","buffer_size","(","int",")",":","The","internal","buffer","size","in","byte",".","Used","only","when","`","src","`","is","file-like","object",".","Default",":","`","4096","`","."]
docstr: The index of default audio stream. ``None`` if there is no audio stream
  
  :type: Optional[int]
docstr_tok: ["The","index","of","default","audio","stream",".","``","None","``","if","there","is","no","audio","stream",":","type",":","Optional","[","int","]"]
code: def default_audio_stream(self):
      """The index of default audio stream. ``None`` if there is no audio stream
  
      :type: Optional[int]
      """
      return self._default_audio_stream
  
imports: from __future__ import annotations
  import os
  from dataclasses import dataclass
  from pathlib import Path
  from typing import BinaryIO, Dict, Iterator, Optional, Tuple, TypeVar, Union
  import torch
  import torio
  from torch.utils._pytree import tree_map
label_desc: Use image node_id 4 for calling the StreamingMediaDecoder obj's underlying member method code with example usage: obj.default_audio_stream() and returns: self