Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 1.92 KB

README.md

File metadata and controls

68 lines (44 loc) · 1.92 KB

node-twitch-stream

node-twitch-stream is a Node.js application that allows you to stream a video file to Twitch using the Twitch API and FFmpeg.

Prerequisites

Before running the application, make sure you have the following prerequisites installed:

  • Node.js (version 18.16 or higher) (run nvm use if you use NVM or similar tools)
  • FFmpeg (installed and accessible via the command line)
  • Twitch account with stream key

Installation

  1. Clone the repository:
git clone https://github.com/failfa-st/node-twitch-stream.git
  1. Navigate to the project directory:
cd node-twitch-stream
  1. Install the dependencies:
npm install
  1. Create a .env file in the project root directory and add the following environment variables:
TWITCH_CLIENT_ID=your-twitch-client-id
TWITCH_CLIENT_SECRET=your-twitch-client-secret
TWITCH_STREAM_KEY=your-twitch-stream-key

💡 You can copy the .env.example to .env

Replace your-twitch-client-id, your-twitch-client-secret, and your-twitch-stream-key with your actual Twitch credentials.

  1. Add a file demo.mp4 to the project: path/to/node-twitch-stream/demo.mp4

Usage

To start the streaming process, run the following command:

npm start

The application will authenticate with the Twitch API using the provided client credentials, retrieve an access token, and initiate the streaming of the video file demo.mp4 to Twitch.

Customization

You can customize the video file to be streamed by replacing demo.mp4 in the startStreaming function of index.js with the path to your desired video file.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.