Skip to content

Instantly share code, notes, and snippets.

View recursivecodes's full-sized avatar
💯
Living the dream

Todd Sharp recursivecodes

💯
Living the dream
View GitHub Profile

lets create an html file to broadcast to an amazon ivs low-latency channel using the latest version amazon ivs web broadcast sdk. check the documentation for low-latency streaming with the web broadcast sdk and use my existing channel called demo-channel. to retrieve the channel's stream key from the application, create a function that uses this endpoint: https://[redacted]. use tools at your disposal to find the ingest endpoint for this channel. save the file to /path/to/ivs-web-broadcast-demo.html

⠧ Thinking...
🔨 Calling MCP Server tool 'ivs-knowledgebase-retrieve'...
🔎 Sending MCP Server's 'ivs-knowledgebase-retrieve' response to Bedrock...
⠧ Thinking...
🔨 Calling MCP Server tool 'ivs-knowledgebase-retrieve'...
🔎 Sending MCP Server's 'ivs-knowledgebase-retrieve' response to Bedrock...
⠧ Thinking...
🔨 Calling MCP Server tool 'fetch-url'...

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Amazon IVS Broadcaster</title>
<style>
body {
font-family: Arial, sans-serif;
using UnityEngine;
using Momento.Sdk;
using Momento.Sdk.Auth;
using Momento.Sdk.Config;
using Momento.Sdk.Exceptions;
using Momento.Sdk.Responses;
using System.Threading.Tasks;
using System;
using System.Threading;
using System.Collections;

Project Ivy: Creating a Real-Time Live Streaming Vtube Virtual Assistant

Ivy is a virtual assitant that joins your Amazon IVS (get it? Ivy? IVS?) real-time stage, listens for chat messages that are prefixed with "Hey Ivy", and responds!

Objectives

  • ☒ Build a Virtual Assistant in Unity using a VRoid VRM model
  • ☒ Join Amazon IVS Real-Time Stage
  • ☒ Join Amazon IVS Chat Room
  • ☒ Respond to "Hey Ivy!" chat messages by passing the prompt to Amazon Bedrock

Publish to Stage with WHIP

Test Video & Audio Src

gst-launch-1.0 \
  videotestsrc \
  ! videoconvert \
  ! openh264enc \
  ! rtph264pay \
@recursivecodes
recursivecodes / app.js
Created February 1, 2024 13:58
A sample Node script that could be used with the Audible Magic binary to identify copyrighted content in an Amazon IVS live stream.
import 'dotenv/config';
import { spawn } from 'node:child_process';
import { mkdirSync, readFileSync } from 'node:fs';
import { inspect } from 'node:util';
import Watcher from 'watcher';
import { IvsClient, GetStreamCommand } from "@aws-sdk/client-ivs";
import { SQSClient, ReceiveMessageCommand, DeleteMessageCommand } from "@aws-sdk/client-sqs";
// create AWS SDK clients
const ivsClient = new IvsClient();
@recursivecodes
recursivecodes / TwitchPublish.cs
Created January 23, 2024 21:48
A demo of broadcasting directly to Twitch from a game built in Unity.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.WebRTC;
using UnityEngine.Networking;
using UnityEngine.UI;
[RequireComponent(typeof(AudioListener))]
public class TwitchPublish : MonoBehaviour
{
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
using Unity.WebRTC;
using UnityEngine.Networking;
using Unity.RenderStreaming;
using UnityEngine.UI;
using NativeWebSocket;
@recursivecodes
recursivecodes / WebRTCPublish.cs
Created January 23, 2024 14:49
This script is an example of how to create dynamic user controlled cameras and modify the environment and objectives of a Unity game that is live streamed to Amazon IVS.
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
using Unity.WebRTC;
using UnityEngine.Networking;
using Cinemachine;
using NativeWebSocket;
[System.Serializable]
@recursivecodes
recursivecodes / IVSChat.cs
Created January 19, 2024 16:46
A script to integrate Amazon IVS chat into a Unity game.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using NativeWebSocket;
using TMPro;