{"id":15724155,"url":"https://github.com/lkmio/lkm","last_synced_at":"2025-04-09T07:09:22.444Z","repository":{"id":248518247,"uuid":"828922102","full_name":"lkmio/lkm","owner":"lkmio","description":"A high-performance, Go-based streaming media server that supports JT/T 1078 and GB28181 protocols.","archived":false,"fork":false,"pushed_at":"2025-01-11T03:13:18.000Z","size":618,"stargazers_count":83,"open_issues_count":8,"forks_count":15,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2025-04-02T06:07:02.100Z","etag":null,"topics":["1078","gb28181","http-flv","rtmp","rtsp","webrtc","ws-flv"],"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/lkmio.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":"2024-07-15T11:54:25.000Z","updated_at":"2025-04-01T14:47:08.000Z","dependencies_parsed_at":"2024-10-24T17:54:05.641Z","dependency_job_id":"9dcc3e11-b08d-4b1d-b3c9-0f9c4a9131d0","html_url":"https://github.com/lkmio/lkm","commit_stats":{"total_commits":132,"total_committers":1,"mean_commits":132.0,"dds":0.0,"last_synced_commit":"60a7a949791992c5802bff0c461549c4a106b8d4"},"previous_names":["lkmio/lkm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkmio%2Flkm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkmio%2Flkm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkmio%2Flkm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkmio%2Flkm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lkmio","download_url":"https://codeload.github.com/lkmio/lkm/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994122,"owners_count":21030050,"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":["1078","gb28181","http-flv","rtmp","rtsp","webrtc","ws-flv"],"created_at":"2024-10-03T22:15:08.162Z","updated_at":"2025-04-09T07:09:22.424Z","avatar_url":"https://github.com/lkmio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 简介\n\n基于GoLang实现的流媒体服务器，支持RTMP、GB28181、1078推流，输出rtmp/http-flv/ws-flv/webrtc/hls/rtsp等拉流协议。支持如下编码器和流协议：\n\n| Codec\\Stream | RTMP | FLV | HLS | RTC | RTSP |\n| ------------ | ---- | --- | --- | --- | ---- |\n| H264         | √    | √   | √   | √   | √    |\n| H265         | √    | √   | √   | -([有计划支持](https://linkingvision.com/webrtch265))   | √    |\n| G711A/U      | √    | √   | -   | √   | √    |\n| AAC          | √    | √   | √   | -   | √    |\n| OPUS         | -    | -   | -   | √   | -    |\n\n## 编译\n\n在使用之前，建议先阅读[LKM启动配置文件参数说明](https://github.com/lkmio/lkm/wiki/Startup-Parameters)。如果你想修改源码，推荐阅读[LKM源码分析](https://github.com/lkmio/lkm/wiki/Source-Code-Analysis)。\n\n### 源码编译\n\n     git clone https://github.com/lkmio/avformat.git\n     git clone https://github.com/lkmio/lkm.git\n     cd lkm\n     go mod tidy\n     go mod vendor\n     go build\n\n### docker编译\n\n     ./build_docker_images.sh GOOS=linux GOARCH=amd64\n\n\n支持修改`GOOS`和`GOARCH`参数来决定编译平台。默认编译制作`linx amd64`平台的镜像，如果宿主机有golang编译环境，则以宿主机平台为准。优先级如下：编译时指定平台 \u003e 宿主机平台 \u003e 默认平台。\n\n### docker启动\n\n* 目前还未发布到dockerhub\n\n```\nsudo docker run --log-driver json-file --log-opt max-size=10m --network=host -it lkm:latest /bin/sh\n```\n\n\n\n## RTMP推流\n\nffmpeg推流示例：\n\n    ffmpeg -re -i ./232937384-1-208_baseline.mp4 -c copy -f flv rtmp://127.0.0.1/hls/mystream\n\n拉流地址示例：\n\n    [\n    \t\"rtmp://192.168.2.148:1935/hls/mystream\",\n    \t\"rtsp://192.168.2.148:554/hls/mystream\",\n    \t\"http://192.168.2.148:8080/hls/mystream.flv\",\n    \t\"http://192.168.2.148:8080/hls/mystream.rtc\",\n    \t\"ws://192.168.2.148:8080/hls/mystream.flv\"\n    ]\n\n## GB28181推流\n\n1.  [安装信令服务器](https://github.com/lkmio/gb-cms)\n2.  配置[http hooks](https://github.com/lkmio/lkm/wiki/Startup-Parameters#hook)\n3.  查询在线设备\n\u003e curl -v http://localhost:9000/api/v1/device/list\n3.  使用ffplay播放\n\n```\n// 实时预览-UDP方式 34020000001320000001设备下的34020000001310000001通道\nffplay -i rtmp://127.0.0.1/34020000001320000001/34020000001310000001\n// 实时预览-TCP被动方式 34020000001320000001设备下的34020000001310000001通道\nffplay -i rtmp://127.0.0.1/34020000001320000001/34020000001310000001?setup=passive\nffplay -i http://127.0.0.1:8080/34020000001320000001/34020000001310000001.flv?setup=passive\nffplay -i http://127.0.0.1:8080/34020000001320000001/34020000001310000001.m3u8?setup=passive\nffplay -i rtsp://test:123456@127.0.0.1/34020000001320000001/34020000001310000001?setup=passive\n// 回放-TCP被动方式 34020000001320000001设备下的34020000001310000001通道\nffplay -i rtmp://127.0.0.1/34020000001320000001/34020000001310000001.session_id_0?setup=passive\u0026stream_type=playback\u0026start_time=2024-06-18T15:20:56\u0026end_time=2024-06-18T15:25:56\n\n```\n\n## 1078推流\n\n\u003e 需自行安装信令服务, 告知设备推流到LKM的收流端口\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkmio%2Flkm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flkmio%2Flkm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkmio%2Flkm/lists"}