{"id":13906605,"url":"https://github.com/m1k1o/hls-restream","last_synced_at":"2025-10-04T02:22:50.051Z","repository":{"id":47271487,"uuid":"283014635","full_name":"m1k1o/hls-restream","owner":"m1k1o","description":"Restream live content as HLS using ffmpeg in docker. Also with NVIDIA GPU hardware acceleration.","archived":false,"fork":false,"pushed_at":"2022-10-04T16:26:30.000Z","size":47,"stargazers_count":42,"open_issues_count":2,"forks_count":25,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-27T20:11:16.965Z","etag":null,"topics":["docker","ffmpeg","hls-live-streaming","hls-restream","nvidia-cuda","restream"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/m1k1o.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}},"created_at":"2020-07-27T20:56:31.000Z","updated_at":"2025-03-08T09:53:42.000Z","dependencies_parsed_at":"2022-09-05T14:41:15.339Z","dependency_job_id":null,"html_url":"https://github.com/m1k1o/hls-restream","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1k1o%2Fhls-restream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1k1o%2Fhls-restream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1k1o%2Fhls-restream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1k1o%2Fhls-restream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m1k1o","download_url":"https://codeload.github.com/m1k1o/hls-restream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248831046,"owners_count":21168393,"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","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":["docker","ffmpeg","hls-live-streaming","hls-restream","nvidia-cuda","restream"],"created_at":"2024-08-06T23:01:39.024Z","updated_at":"2025-10-04T02:22:45.032Z","avatar_url":"https://github.com/m1k1o.png","language":"Shell","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# hls-restream\nRestream live content as HLS using ffmpeg in docker.\n\n# Usage\n\nYou need to have docker \u0026 docker-compose installed.\n\n1. Clone this repository:\n```sh\ngit clone https://github.com/m1k1o/hls-restream\ncd hls-restream\n```\n\n2. Modify `docker-compose.yml` and add your own sources:\n```yml\nversion: \"3.4\"\nservices:\n  hls:\n    build: \"./\"\n    container_name: \"hls\"\n    restart: \"always\"\n    tmpfs:\n      - \"/var/www/html:mode=777,size=128M,uid=1000,gid=1000\"\n    ports:\n      - \"80:80\"\n    environment:\n      PROFILE: passthrough\n      SOURCES: |\n        # SD Channels:\n        ch1     rtsp://192.168.1.5:554/ch1\n        ch2     rtsp://192.168.1.5:554/ch2\n        # HD Channels:\n        ch1_hd  http://192.168.1.6/stream/channelid/8967896?profile=pass\n        ch2_hd  http://192.168.1.6/stream/channelid/4969639?profile=pass\n```\n\nProfiles can you find in `profiles/` folder.\n* passthrough - default, no transcoding.\n\nH264 adaptive bitrate transcoding:\n* abr_transcoding_sd - 360p and 480p\n* abr_transcoding_hd - 360p, 480p and 720p\n* abr_transcoding_hd_1080p - 360p, 480p, 720p and 1080p\n\nH264 transcoding:\n* transcoding_hd - 720p only\n* transcoding_sd - 480p only\n\n3. Start docker compose (run this everytime you modify stream sources):\n```sh\ndocker-compose up -d --build\n```\n\n4. Watch streams:\n```\nhttp://localhost/ch1.m3u8\nhttp://localhost/ch2.m3u8\nhttp://localhost/ch1_hd.m3u8\nhttp://localhost/ch2_hd.m3u8\n```\n\nIn case of error, troubleshoot:\n\n```sh\ndocker logs hls\ndocker exec -it hls sh -c 'cd /var/log/supervisor \u0026\u0026 /bin/bash'\n```\n\n# NVIDIA GPU hardware acceleration\n\nYou will need to have [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) installed.\n\n```\ndocker build -t hls_nvidia -f Dockerfile.nvidia .\ndocker run -d --gpus=all \\\n  --name hls_nvidia \\\n  --tmpfs /var/www/html:mode=777,size=128M,uid=1000,gid=1000 \\\n  -p 80:80 \\\n  -e 'PROFILE=transcoding_sd' \\\n  -e 'SOURCES=\n        # SD Channels:\n        ch1     rtsp://192.168.1.5:554/ch1\n        ch2     rtsp://192.168.1.5:554/ch2\n        # HD Channels:\n        ch1_hd  http://192.168.1.6/stream/channelid/8967896?profile=pass\n        ch2_hd  http://192.168.1.6/stream/channelid/4969639?profile=pass\n  ' \\\n  hls_nvidia\n```\n\n## Supported inputs\n\nInput codec will be automatically determined from given stream. Please check your graphic card's supported codec and maximum concurrent sessions [here](https://developer.nvidia.com/video-encode-decode-gpu-support-matrix).\n\n| Codec      | CUVID       | Codec Name                                |\n| ---------- | ----------- | ----------------------------------------- |\n| h264       | h264_cuvid  | H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 |\n| hevc       | hevc_cuvid  | H.265 / HEVC                              |\n| mjpeg      | mjpeg_cuvid | Motion JPEG                               |\n| mpeg1video | mpeg1_cuvid | MPEG-1 video                              |\n| mpeg2video | mpeg2_cuvid | MPEG-2 video                              |\n| mpeg4      | mpeg4_cuvid | MPEG-4 part 2                             |\n| vc1        | vc1_cuvid   | SMPTE VC-1                                |\n| vp8        | vp8_cuvid   | On2 VP8                                   |\n| vp9        | vp9_cuvid   | Google VP9                                |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1k1o%2Fhls-restream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm1k1o%2Fhls-restream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1k1o%2Fhls-restream/lists"}