docs: async def stop(self):
          """
          Stop recording.
          """
          if self.__container:
              for track, context in self.__tracks.items():
                  if context.task is not None:
                      context.task.cancel()
                      context.task = None
                      for packet in context.stream.encode(None):
                          self.__container.mux(packet)
              self.__tracks = {}
  
              if self.__container:
                  self.__container.close()
                  self.__container = None