{"id":13904937,"url":"https://github.com/oatpp/example-hls-media-stream","last_synced_at":"2025-04-25T20:30:30.780Z","repository":{"id":98397815,"uuid":"168071288","full_name":"oatpp/example-hls-media-stream","owner":"oatpp","description":"Example project how-to build HLS-streaming server using oat++ Async-API.","archived":false,"fork":false,"pushed_at":"2024-04-22T21:27:12.000Z","size":78620,"stargazers_count":70,"open_issues_count":0,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T23:45:31.777Z","etag":null,"topics":["async","cpp","hls-live-streaming","hls-server","oatpp"],"latest_commit_sha":null,"homepage":"https://oatpp.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oatpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-01-29T02:01:07.000Z","updated_at":"2024-05-30T21:43:17.000Z","dependencies_parsed_at":"2024-11-07T01:34:54.193Z","dependency_job_id":null,"html_url":"https://github.com/oatpp/example-hls-media-stream","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"afcb50f12abb3de6bfe6f8842898d26a4a6e4180"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fexample-hls-media-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fexample-hls-media-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fexample-hls-media-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fexample-hls-media-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oatpp","download_url":"https://codeload.github.com/oatpp/example-hls-media-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224015655,"owners_count":17241535,"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":["async","cpp","hls-live-streaming","hls-server","oatpp"],"created_at":"2024-08-06T23:01:06.932Z","updated_at":"2024-11-10T21:22:57.389Z","avatar_url":"https://github.com/oatpp.png","language":"C++","readme":"# Example-HLS-Media-Stream [![Build Status](https://dev.azure.com/lganzzzo/lganzzzo/_apis/build/status/oatpp.example-hls-media-stream?branchName=master)](https://dev.azure.com/lganzzzo/lganzzzo/_build?definitionId=12\u0026branchName=master)\n\nExample project how-to build HLS-streaming server using oat++ (AKA oatpp) Async API.\n\nLive stream is tested with Safari-Browser and VLC-player\n\nSee more:\n\n- [Oat++ Website](https://oatpp.io/)\n- [Oat++ Github Repository](https://github.com/oatpp/oatpp)\n- [Get Started](https://oatpp.io/docs/start)\n\n## Overview\n\nServer generates infinite .m3u8 playlist from the pre-generated \n```playlist_live.m3u8``` file in the ```video``` folder.  \nFile ```video/playlist_live.m3u8``` together with video chunks is generated using ```ffmpeg```.  \n\nServer is built using oat++ Async-Api and has following endpoints:\n\n- ```(\"GET\", \"/\", Root)``` - Starting html-page aka index.html\n- ```(\"GET\", \"video/*\", Video)``` - Embedded video html-page \n- ```(\"GET\", \"media/live\", Live)``` - Infinite HLS playlist for live-stream describing video chunks\n- ```(\"GET\", \"media/*\", Static)``` - Endpoint serving media files with range requests support\n\n### Project layout\n\n```\n\n|- CMakeLists.txt                       // projects CMakeLists.txt\n|- src/                                 // source folder\n|- test/                                // test folder\n|- utility/install-oatpp-modules.sh     // utility script to install required oatpp-modules.\n|\n|- video/                               // media files and playlists here\n     |- generate_pls.sh                 // example how to use ```ffmpeg``` to generate initial playlist and video chunks\n     |- playlist_live.m3u8              // playlist used to generate infinite playlist for http-live-streaming\n\n```\n```\n- src/\n    |\n    |- controller/              // Folder containing UserController where all endpoints are declared\n    |- hls/                     // Playlist generator is here\n    |- Utils.hpp                // Utils\n    |- AppComponent.hpp         // Service config\n    |- App.cpp                  // main() is here\n    \n```\n\n---\n\n### Build and Run\n\n#### Using CMake\n\n**Requires**\n\n- `oatpp` module installed. You may run `utility/install-oatpp-modules.sh` \nscript to install required oatpp modules.\n\n```\n$ mkdir build \u0026\u0026 cd build\n$ cmake ..\n$ make \n$ ./hls-example-exe             # - run application.\n```\n\n#### In Docker\n\n```\n$ docker build -t example-hls .\n$ docker run -p 8000:8000 -t example-hls\n```\n\n---\n\n### Screenshots\n\n\u003cimg src=\"https://github.com/oatpp/example-hls-media-stream/blob/master/screenshots/screen-2.png\" width=\"33%\"\u003e\u003cimg src=\"https://github.com/oatpp/example-hls-media-stream/blob/master/screenshots/screen-3.png\" width=\"33%\"\u003e\u003cimg src=\"https://github.com/oatpp/example-hls-media-stream/blob/master/screenshots/screen-4.png\" width=\"33%\"\u003e\n\n---\n## Notes\n\n### Urls\n- localhost:8000 - Index page\n- localhost:8000/media/live - Live stream made from {repo}/video/video1.mp4 and {repo}/video/video2.mp4 played in the loop\n\n### Files\n- {repo}/video/playlist_live.m3u8 - playlist used for live HLS streaming\n- {repo}/video/generate_pls.sh - example script used to generate sub-playlists and video fragmets using ffmpeg tool. #EXTINF sections of sub-playlists then have to be manualy moved to playlist_live.m3u8.\n\n### Note\nIf app can't find playlist of video files then specify full-file-paths for {repo}/video/playlist_live.m3u8 file and {repo}/video folder in AppComponent.hpp\n\n","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Fexample-hls-media-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foatpp%2Fexample-hls-media-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Fexample-hls-media-stream/lists"}