| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Optimized YouTube 24/7 streaming script that reduces costs from ~$2 to ~$0.20 by eliminating unnecessary video processing.
Smart Download (yt-dlp): Forces YouTube to provide a 1080p H.264 file specifically, ensuring the video is already in the perfect format for streaming.
Direct Stream Copy (ffmpeg): Uses -c copy to remove all video processing. Instead of "reading, decoding, resizing, re-encoding, and sending," it now just "reads and sends," reducing CPU usage by ~99%.
Install Python dependencies:
pip install -r requirements.txtCreate a .env file in the project root with your credentials:
STREAM_KEY=your_youtube_stream_key_here YouTube_ID=your_youtube_video_id_here
Run the stream:
python stream.pyBuild the Docker image:
docker build -t youtube-stream .Run the container with environment variables:
docker run -d --name youtube-stream \
-e STREAM_KEY=your_youtube_stream_key_here \
-e YouTube_ID=your_youtube_video_id_here \
youtube-streamOr use a .env file (make sure it's in the same directory):
docker run -d --name youtube-stream \
--env-file .env \
youtube-streamView logs:
docker logs -f youtube-streamStop the container:
docker stop youtube-stream
docker rm youtube-streamThe script downloads a YouTube video in the exact format needed (1080p H.264 MP4) and streams it directly to YouTube's RTMP server using stream copy mode, which requires minimal CPU resources since no re-encoding occurs.
| Back | FazBrowse Home | New Git URL |