{"id":13906300,"url":"https://github.com/ftp27/GoHLStreamer","last_synced_at":"2025-07-18T04:30:50.135Z","repository":{"id":185478070,"uuid":"655685248","full_name":"ftp27/GoHLStreamer","owner":"ftp27","description":"Go-based server that streams video content in the HTTP Live Streaming (HLS) format","archived":false,"fork":false,"pushed_at":"2023-06-23T14:09:43.000Z","size":21,"stargazers_count":18,"open_issues_count":0,"forks_count":54,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-21T21:52:26.642Z","etag":null,"topics":["appwrite","hls","hls-stream"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ftp27.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}},"created_at":"2023-06-19T11:45:18.000Z","updated_at":"2024-11-13T02:29:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7ba168e-bf8f-48de-b10c-75882bfdda65","html_url":"https://github.com/ftp27/GoHLStreamer","commit_stats":null,"previous_names":["ftp27/gohlstreamer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftp27%2FGoHLStreamer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftp27%2FGoHLStreamer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftp27%2FGoHLStreamer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftp27%2FGoHLStreamer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ftp27","download_url":"https://codeload.github.com/ftp27/GoHLStreamer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226344596,"owners_count":17610173,"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":["appwrite","hls","hls-stream"],"created_at":"2024-08-06T23:01:33.032Z","updated_at":"2024-11-25T14:31:15.144Z","avatar_url":"https://github.com/ftp27.png","language":"Go","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# GoHLStreamer\n\nGoHLStreamer is a Go-based server that streams video content in the HTTP Live Streaming (HLS) format. It allows you to convert MP4 files to HLS and serve them over HTTP. The server uses DigitalOcean Spaces for storing the MP4 files and the generated HLS files.\n\nThis project adds support for HTTP Live Streaming (HLS) to your Appwrite server. If you're not using Appwrite server, you can still use this project to load MP4 files from DigitalOcean Spaces (or another solution by defining the proper host). \n\nAll files for streaming will be saved in the output directory on the Object Storage during the first load. Therefore, the initial load may take longer due to the export process. However, subsequent fetches will utilize the cached files from the Object Storage, resulting in faster loading times.\n\n## Features\n\n- Converts MP4 files to HLS format on-the-fly.\n- Serves HLS streams for smooth video playback.\n- Loading files from Appwrite server or DigitalOcean Spaces.\n- Uses DigitalOcean Spaces for storing the media files.\n- Easy to set up and configure.\n\n## Prerequisites\n\n- Go 1.15 or higher installed\n- FFmpeg installed (used for MP4 to HLS conversion)\n- DigitalOcean Spaces account with API credentials\n\n## Installation\n\n### Manual\n\n1. Clone the repository:\n\n```shell\ngit clone https://github.com/ftp27/GoHLStreamer.git\n```\n\n2. Change into the project directory:\n\n```shell\ncd GoHLStreamer\n```\n\n3. Install the dependencies:\n\n```shell\ngo mod download\n```\n\n4. Set up your environment by creating a `.env` file in the project directory with the following contents:\n\n```shell\nENDPOINT=\u003cDigitalOcean Spaces endpoint\u003e\nACCESS_KEY_ID=\u003cDigitalOcean Spaces access key\u003e\nSECRET_ACCESS_KEY=\u003cDigitalOcean Spaces secret key\u003e\nBUCKET_NAME=\u003cDigitalOcean Spaces bucket name\u003e\nBASE_URL=\u003cBase URL where the server will be hosted\u003e\nTEMP_DIR=\u003cTemporary directory path for HLS conversion\u003e\nINPUT_DIR=\u003cLocation of mp4 files in DigitalOcean Spaces\u003e\nOUTPUT_DIR=\u003cLocation of m3u8 files in DigitalOcean Spaces\u003e\nFFMPEG_PATH=\u003cPath to the FFmpeg binary\u003e\nCACHE_SIZE=\u003cThe number of files can be kept keep local\u003e\n```\n\nIf you want to use Appwrite instead of DigitalOcean Spaces, you can use the following environment variables:\n\n```shell\nAPPWRITE_HOST=\u003cAppwrite host\u003e\nAPPWRITE_PROJECT=\u003cAppwrite project ID\u003e\nAPPWRITE_SECRET=\u003cAppwrite secret key\u003e\nAPPWRITE_BUCKET=\u003cAppwrite storage bucket\u003e\n```\n\n5. Run the server:\n\n```shell\ngo run main.go\n```\n\nBy default, the server will be available at `http://localhost:8080`. Adjust the `BASE_URL` value in the `.env` file to match your server's actual URL.\n\n### Docker\n\nTo run the GoHLSStreamer server using Docker, follow these steps:\n\n1. Install Docker on your machine by following the instructions specific to your operating system: [Docker Installation Guide](https://docs.docker.com/get-docker/).\n\n2. Clone the repository:\n\n   ```bash\n   git clone https://github.com/ftp27/GoHLSStreamer.git\n   ```\n\n3. Navigate to the project directory:\n\n   ```bash\n   cd GoHLSStreamer\n   ```\n\n4. Build the Docker image:\n\n   ```bash\n   docker build -t gohlsstreamer .\n   ```\n\n   This command will build the Docker image based on the provided `Dockerfile`.\n\n5. Run the Docker container:\n\n   ```bash\n   docker run  --env-file .env -p 8080:8080 gohlsstreamer\n   ```\n\n   This command will start the GoHLSStreamer server inside the Docker container and map port 8080 of the container to port 8080 on your local machine.\n\n## Usage\n\n1. Upload your MP4 files to the specified DigitalOcean Spaces bucket.\n\n2. Access the HLS streams by appending `/hls/\u003cobject-name\u003e/playlist.m3u8` to the server's URL.\n\nExample:\n```\nhttp://your-server-url/hls/\u003cobject-name\u003e/playlist.m3u8\n```\n\n## Contributing\n\nContributions are welcome! If you find any issues or have suggestions for improvements, please submit an issue or a pull request.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftp27%2FGoHLStreamer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fftp27%2FGoHLStreamer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftp27%2FGoHLStreamer/lists"}