Skip to content

Automatic Stream Configuration for AWS IVS

License

Notifications You must be signed in to change notification settings

anttiai/ivs-asc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatic Stream Configuration for AWS IVS.

Use createClientConfiguration to generate a ClientConfiguration object by combining the user's hardware and software setup analysis with the desired streaming options. Use fetchStreamConfiguration to query the AWS IVS REST API for the optimal streaming configuration.

Automatic stream configuration helps users get started quickly and automatically improves the quality of streams over time. Instead of users manually choosing settings (e.g., bitrate, resolution, framerate) that are set once and rarely tweaked, automatic stream configuration considers current software settings, hardware configuration, and platform support every time the user starts a new stream. For example, when a user upgrades the setup (e.g., with a new GPU), installs a new GPU driver, or the destination starts to support a new codec (e.g., H.265/HEVC), automatic stream configuration reacts and improves the quality of the user's next stream.

AWS documentation at docs.aws.amazon.com.

Supported GPUs

  • Nvidia: Requires nvidia-smi
  • Apple silicon: No additional software required
  • AMD: PRs welcome for device_id and vendor_id heuristics

Installation

npm install ivs-asc --save

Usage

Create and print out the client configuration

import { createClientConfiguration, FetchOptions } from 'ivs-asc';

const options: FetchOptions = {
    authKey: 'authkey',
    video: { width: 1920, height: 1080, fps: 60 }
}
createClientConfiguration(options).then(console.log);

Fetch optimal streaming configuration from IVS

import { fetchStreamConfiguration, FetchOptions, IVSResponse } from 'ivs-asc';

async function automaticStreamConfiguration() {
    const options: FetchOptions = {
        authKey: 'authkey',
        video: {
            width: 1920,
            height: 1080,
            fps: 60,
            maxBitrateKbps: 4000,
            maxTracks: 3,
            supportedCodecs: ["h264", "h265", "av1"]
        }
    }

    const clientConfiguration = await createClientConfiguration(options);
    const response: IVSResponse = await fetchStreamConfiguration(clientConfiguration);
    if (response.status?.result === 'error') {
        console.log(response.status.html_en_us);
    }
    else {
        console.log(response);
    }
}
automaticStreamConfiguration();

About

Automatic Stream Configuration for AWS IVS

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published