Giter Club home page Giter Club logo

amazon-ivs-broadcast-web-demo's Introduction

Amazon IVS Broadcast Web Demo

A demo web application intended as an educational tool to demonstrate how you can build a browser-based streaming tool with the Amazon IVS Web Broadcast SDK.

Demo: Visit https://stream.ivs.rocks/ and add your channel's ingest endpoint and stream key on the settings screen.

A web browser showing the demo application with a woman speaking into a camera.

This project is intended for education purposes only and not for production usage.

Prerequisites

Running the demo

Follow these instructions to run the demo:

  1. Run: yarn install
  2. Run: yarn run dev

Customizing the demo

To customize this demo, fork it and modify the source code to suit your needs.

Change color theme

To modify the colors used in the application UI, modify the colors defined in tailwind.config.js.

Change layouts

To modify the available layouts or add your own, modify the contents of BroadcastLayoutTemplates.js. Math expressions within strings are supported and include the following variables:

CANVAS_WIDTH // the width of the canvas
CANVAS_HEIGHT // the height of the canvas
LAYER_WIDTH // the width of the current layer
LAYER_HEIGHT // the height of the current layer

Known issues and limitations

  • The application is meant for demonstration purposes and not for production use.
  • This application is only tested and supported on the latest Desktop versions of Chrome and Firefox. Other browsers and devices, including mobile browsers and smartphones, may work with this tool, but are not officially supported at this time.

About Amazon IVS

Amazon Interactive Video Service (Amazon IVS) is a managed live streaming and stream chat solution that is quick and easy to set up, and ideal for creating interactive video experiences. Learn more.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License.

amazon-ivs-broadcast-web-demo's People

Contributors

amazon-auto avatar dependabot[bot] avatar slee-aws avatar tonyv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazon-ivs-broadcast-web-demo's Issues

Audio synchronization issues occur when streaming in Full HD on the iPhone

I'm experiencing an audio synchronization issue that only occurs in the iPhone browsers (Chrome and Safari). When I'm streaming in Full HD (both BASIC_FULL_HD and STANDARD), the video starts to lag behind. I've tried various modifications, but I can't seem to adjust it.

This issue hasn't been observed on Android, Mac, or Desktop.

Npm install failure and get

I try to run npm install on the branch. However, I got

-> npm install
npm WARN deprecated [email protected]: core-js-pure@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js-pure.
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/next/-/next-13.5.0.tgz - Not found
npm ERR! 404
npm ERR! 404 'next@https://registry.npmjs.org/next/-/next-13.5.0.tgz' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: /Users/xxxxxxxx/.npm/_logs/2023-12-23T00_33_41_701Z-debug-0.log

Any comment?

Thanks

copy from .npm/_logs/2023-12-23T00_33_41_701Z-debug-0.log

more .npm/_logs/2023-12-23T00_33_41_701Z-debug-0.log
0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 0ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/manwan/Downloads/tmp/amazon-ivs-broadcast-web-demo/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms

IVS Broadcast Client Issues

Hello,
We want to use the IVS service in a mobile application that includes a webview, but we’re encountering some issues. Before diving into those, let’s provide some brief information:

  • We are broadcasting from a React app within a WebView on both iOS and Android platforms, using the IVS Web Broadcast Client v1.5.2. We play the broadcast on both platforms by playing the associated .m3u8 file.
    Here are the problems we are facing:
  1. On the Android platform, we are getting different responses for different streamConfig settings.
    a. streamConfig->maxResolution -> We set width and height as 412*880, which we get from window.innerWidth and window.innerHeight,
    b. streamConfig->maxFramerate -> 30
    c. streamConfig->maxBitrate -> With resolution and FPS being constant; we have tried this with many values ranging from 1000 to 8500.
  • In the above case, the broadcast doesn’t start at all. A session is created under the channel in IVS, but it cannot switch to LIVE status because;
    • According to IVS, video bitrate appears as 0 kbps, FPS is 0. Audio bitrate varies between 0-20kbps.
    • 11 seconds after reaching “Session Created” status, it enters the “Starvation Start” status.
  • In this case, we tried many different values for maxResolution; the broadcast starts and flows smoothly with some, but the above situation occurs in others.
  • Additionally, we couldn’t find a pattern among these values. Some examples are;
    • 720x1440 -> OK
    • 720x1350 -> FAIL
    • 600x1280 -> OK
    • 599x1280 -> FAIL
    • 720x1340 -> OK
  • We conducted similar tests using a pure JS proof-of-concept (POC) on 6 different Android devices from various brands, such as Samsung, Xiaomi, and Oppo. Interestingly, some resolutions that generally fail were able to broadcast for a short duration (30-40 seconds) before entering “Starvation” status and dropping to 0 kbps bitrate. This was observed on a high-end Xiaomi Mi 12 Pro and a lower-end Samsung A33.
  1. When watching the broadcast, the iOS platform always receives the broadcast with a delay of 5 to 10 seconds compared to the Android platform.
  2. There is an audio-visual synchronization issue in the broadcast; we experienced an audio-visual lag problem as soon as the broadcast started on iPhone 11, with the following streamConfig settings:
    a. maxResolution -> 720x1280
    b. maxFramerate -> 30
    c. maxBitrate -> 2000

We need to find solutions for these problems as soon as possible and we would be very happy if you could help us.

Devices with pixel ratio greater than 1

Having issues adapting this for mobile, specifically devices with aspect ratios greater than 1 that record in portrait. The results I want is a full screen portrait preview that works on iOS. Any examples or guidance will help!

const renderActiveVideoDevice = (overrideDeviceId?: string) => {
		const canvas = IVSClient.current.getCanvasDimensions();
		const layer = {
			device:
				overrideDeviceId ||
				selectedVideoDevice ||
				videoDevices[0]?.deviceId,
			name: CAM_LAYER_NAME,
			index: 4,
			visible: !camMuted,
			x: 0,
			y: 0,
			width: canvas.width / window.devicePixelRatio,
			height: canvas.height / window.devicePixelRatio,
			type: 'VIDEO'
		};

		addLayer(layer, IVSClient.current);
	};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.