Skip to content

Latest commit

 

History

History
92 lines (87 loc) · 10.5 KB

newstreampayload.md

File metadata and controls

92 lines (87 loc) · 10.5 KB

NewStreamPayload

Example Usage

import {
  NewStreamPayload,
  Profile,
  TranscodeProfileEncoder,
  TranscodeProfileProfile,
  Type,
} from "livepeer/models/components";

let value: NewStreamPayload = {
  name: "test_stream",
  pull: {
    source: "https://myservice.com/live/stream.flv",
    headers: {
      "Authorization": "Bearer 123",
    },
    location: {
      lat: 39.739,
      lon: -104.988,
    },
  },
  playbackPolicy: {
    type: Type.Webhook,
    webhookId: "1bde4o2i6xycudoy",
    webhookContext: {
      "streamerId": "my-custom-id",
    },
    refreshInterval: 600,
  },
  profiles: [
    {
      width: 1280,
      name: "720p",
      height: 720,
      bitrate: 3000000,
      fps: 30,
      fpsDen: 1,
      quality: 23,
      gop: "2",
      profile: Profile.H264Baseline,
    },
  ],
  record: false,
  recordingSpec: {
    profiles: [
      {
        width: 1280,
        name: "720p",
        height: 720,
        bitrate: 3000000,
        quality: 23,
        fps: 30,
        fpsDen: 1,
        gop: "2",
        profile: TranscodeProfileProfile.H264Baseline,
        encoder: TranscodeProfileEncoder.H264,
      },
    ],
  },
  multistream: {
    targets: [
      {
        profile: "720p",
        videoOnly: false,
        id: "PUSH123",
        spec: {
          name: "My target",
          url: "rtmps://live.my-service.tv/channel/secretKey",
        },
      },
    ],
  },
};

Fields

Field Type Required Description Example
name string ✔️ N/A test_stream
pull components.Pull Configuration for a stream that should be actively pulled from an
external source, rather than pushed to Livepeer. If specified, the
stream will not have a streamKey.
creatorId components.InputCreatorId N/A
playbackPolicy components.PlaybackPolicy Whether the playback policy for an asset or stream is public or signed
profiles components.FfmpegProfile[] N/A
record boolean Should this stream be recorded? Uses default settings. For more
customization, create and configure an object store.
false
recordingSpec components.NewStreamPayloadRecordingSpec N/A
multistream components.Multistream N/A
userTags Record<string, components.UserTags> User input tags associated with the stream