Viam SDK
    Preparing search index...

    Class VideoClient

    A gRPC-web client for a Video service.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    callOptions: CallOptions = ...
    name: string

    The name of the resource.

    Methods

    • Send/receive arbitrary commands to the resource.

      Parameters

      • command: Struct | Record<string, JsonValue>

        The command to execute.

      • callOptions: CallOptions = ...

      Returns Promise<JsonValue>

      The result of the command.

    • Get the status of the resource.

      Parameters

      • callOptions: CallOptions = ...

      Returns Promise<JsonValue>

    • Retrieve video data for a given time range.

      Parameters

      • OptionalstartTimestamp: Date

        Start time for the video retrieval.

      • OptionalendTimestamp: Date

        End time for the video retrieval.

      • videoCodec: string = ''

        Codec for the video (e.g., "h264", "h265").

      • videoContainer: string = ''

        Container format (e.g., "mp4", "fmp4").

      • extra: {} = {}

        Additional arguments.

      • callOptions: CallOptions = ...

      Returns AsyncIterable<VideoChunk>

      An async iterable of video chunks.

      const video = new VIAM.VideoClient(machine, 'my_video');
      const videoStream = video.getVideo(
      new Date('2025-01-01T00:00:00Z'),
      new Date('2025-01-01T00:10:00Z'),
      'h264',
      'mp4',
      );

      for await (const chunk of videoStream) {
      console.log('Received video chunk:', chunk.videoData.length, 'bytes');
      }