{"id":15020643,"url":"https://github.com/gaborvecsei/youtube-live-stream-docker","last_synced_at":"2025-08-28T02:42:25.893Z","repository":{"id":84266174,"uuid":"124746125","full_name":"gaborvecsei/YouTube-Live-Stream-Docker","owner":"gaborvecsei","description":"Live stream from a USB webcam with your Raspberry Pi to Youtube","archived":false,"fork":false,"pushed_at":"2024-07-22T15:01:21.000Z","size":60,"stargazers_count":61,"open_issues_count":2,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-28T14:09:29.633Z","etag":null,"topics":["avconv","docker","docker-compose","dockerfiles","ffmpeg","flask","live-streaming","python","python3","raspberry-pi","raspberry-pi-3","rest-api","streaming","webcamera","youtube","youtube-stream"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaborvecsei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-11T10:37:32.000Z","updated_at":"2025-02-03T06:44:59.000Z","dependencies_parsed_at":"2025-04-28T14:09:31.115Z","dependency_job_id":"024d3170-9f57-41da-a087-2a7749b99066","html_url":"https://github.com/gaborvecsei/YouTube-Live-Stream-Docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gaborvecsei/YouTube-Live-Stream-Docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FYouTube-Live-Stream-Docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FYouTube-Live-Stream-Docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FYouTube-Live-Stream-Docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FYouTube-Live-Stream-Docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaborvecsei","download_url":"https://codeload.github.com/gaborvecsei/YouTube-Live-Stream-Docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FYouTube-Live-Stream-Docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272424335,"owners_count":24932893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avconv","docker","docker-compose","dockerfiles","ffmpeg","flask","live-streaming","python","python3","raspberry-pi","raspberry-pi-3","rest-api","streaming","webcamera","youtube","youtube-stream"],"created_at":"2024-09-24T19:55:22.726Z","updated_at":"2025-08-28T02:42:25.884Z","avatar_url":"https://github.com/gaborvecsei.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Youtube Live Stream with Docker\n\n![logo](art/live_stream_youtube_docker_logo.png)\n\nWith this dockerized app, you can use a webcam to stream live video to YouTube\n\n- [Simple Mode](#simple-mode)\n    - [Setup Simple Mode](#setup-simple-mode)\n- [Advanced Mode](#advanced-mode)\n    - [Setup Advanved Mode](#setup-advanced-mode)\n\n----------------------------------\n\n*It was developer for Raspberry Pi, but of course it works with any type of HW as long as it supports Docker.*\n\n## Base Setup\n\n### Install Docker \u0026 Clone Repo:\n\n1. Install `Docker` 🐳\n    - `curl -sSL https://get.docker.com | sh`\n2. Install `docker-compose`\n    - `sudo pip install docker-compose` OR `sudo pip3 install docker-compose`\n3. Clone this repo\n    - `git clone https://github.com/gaborvecsei/YouTube-Live-Stream-Docker.git`\n    - go inside the folder `cd Youtube-Live-Stream-Docker`\n\n## Simple Mode\n\nWith this \"mode\", the streaming starts when your device boots up and shuts down only when you turn off your device or\nstop the docker container. It can be useful when you have a dedicated device, only for this purpose what your only want\nto turn on and off without using ssh and entering commands to the terminal. This method handles these automatically.\n\nI use this mode, so I can have a \"secret eye\" :eyes: on my puppy, when I leave :heart:.\n\n### Setup Simple Mode\n\n1. `cd base_docker_image` then `sudo ./build_base.sh` to build the base image for the other Docker images\n2. Edit `docker-compose.yml`\n    - Change `YOUTUBE_LIVE_KEY` to your personal youtube live stream key which you can find at `https://www.youtube.com/live_dashboard`\n    - Under `devices` change the host mapping if necessary. (By default it uses the `video0`).\n        - For example if you'd like to use `video1` device than change it to: `/dev/video1:/dev/video0`\n\n### Start Simple Mode :ok_hand:\n\n- Go to the `youtube_stream_image` folder and then run command:\n    - `sudo docker-compose up -d`\n\n### Stop Simple Mode :x:\n\n- Go to the `youtube_stream_image` folder and then run command:\n    - `sudo docker-compose down`\n\n----------------------------------\n\n## Advanced Mode\n\nAs I always forgot to turn on/off the stream, now it does it automatically based on the connected\ndevices on your network :sparkles:.\n\nThis is achieved with a *MAC whitelist*. If a MAC address is in the list, that means\nif it's present at your network, the stream will shut down automatically (so you don't have to worry about being\nstreamed, even if it's private). If it's not present then the stream goes live.\n\n```\n                +---------------------------+\n                |                           +\n                |                yes+----\u003estop\n                |                ^        stream\n                |                |\n                v                +\nstart +-----\u003e scan devices +---\u003e is whitelisted MAC\n                ^                present?\n                |                +\n                |                |\n                |                v\n                |                no+-----\u003estart\n                |                         stream\n                |                           +\n                +---------------------------+\n```\n\n### Setup Advanced Mode\n\n1. Perform the same as in [Setup Simple Mode](#setup-simple-mode)\n2. Whitelist device MAC addresses\n    - Edit `master_app_image/code/whitelisted_devices.csv`\n      - This file is responsible for keeping safe MAC addresses, so when this device is present based on `arp-scan` or `nmap` we know, we can shut down the stream\n3. YouTube Private Settings\n    - Don't forget to set yout live stream to `private` at [YouTube Live Dashboard](https://www.youtube.com/live_dashboard)\n\n### Start Advanced Mode :ok_hand:\n\n- `sudo docker-compose up -d`\n\n(For logs you can use `sudo docker-compose logs` or inside the `code` folders you can find the log files)\n\n### Stop Advanced Mode :x:\n\n- `sudo docker-compose down`\n\n### Services (Containers)\n\n- **Device Scanner** :computer:\n    - Responsible to scan the devices in the local network (*localhost*)\n    - Rest Api:\n        ```\n        GET, POST - localhost:8887/device_scan_api/scan\n        result: {\"device_macs\": [\"00:11:22:33:44:55\", ...}\n        ```\n- **YouTube Stream** :camera:\n    - With this we can start or stop a live stream\n    - Rest Api:\n        ```\n        GET, POST - localhost:8888/youtube_stream_api/start\n        GET, POST - localhost:8888/youtube_stream_api/stop\n        GET, POST - localhost:8888/youtube_stream_api/check_health\n        GET, POST - localhost:8888/youtube_stream_api/alive\n        ```\n- **Master App** :crown:\n    - This is the main container which uses the above services to detect whitelisted devices and decide to start or\n    stop the live streaming\n\n----------------------------------\n\n## todo\n\n- [x] device scanning for automatic streamin\n- [x] master - feature architecture\n- [x] create base Dockerfile\n- [ ] logging to DB when was the stream live, which device, etc...\n- [x] easily switch to \"basic mode\". When there is no device scan, it streams when I start it.\n- [x] easily editable `csv` for whitelisting\n- [ ] comments\n- [ ] send (Slack, Gmail, etc...) message when stream started/stopped\n\n----------------------------------\n\n## About\n\nGábor Vecsei\n\n- [Website](https://gaborvecsei.com)\n- [LinkedIn](https://www.linkedin.com/in/gaborvecsei)\n- [Twitter](https://twitter.com/GAwesomeBE)\n- [Github](https://github.com/gaborvecsei)\n- [Personal Blog](https://gaborvecsei.wordpress.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaborvecsei%2Fyoutube-live-stream-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaborvecsei%2Fyoutube-live-stream-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaborvecsei%2Fyoutube-live-stream-docker/lists"}