{"id":13547290,"url":"https://github.com/dista/nginx-g-streaming","last_synced_at":"2025-04-02T19:32:53.429Z","repository":{"id":143012859,"uuid":"93363922","full_name":"dista/nginx-g-streaming","owner":"dista","description":"nginx G streaming: http-flv, rtmp streaming🌤","archived":false,"fork":true,"pushed_at":"2023-09-25T15:02:42.000Z","size":3218,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-03T15:38:36.296Z","etag":null,"topics":["http-flv","nginx","rtmp-server","streaming-server"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"arut/nginx-rtmp-module","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dista.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":"2017-06-05T04:10:06.000Z","updated_at":"2023-11-03T03:08:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"c00395e7-8c43-4633-891a-e42cca748676","html_url":"https://github.com/dista/nginx-g-streaming","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dista%2Fnginx-g-streaming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dista%2Fnginx-g-streaming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dista%2Fnginx-g-streaming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dista%2Fnginx-g-streaming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dista","download_url":"https://codeload.github.com/dista/nginx-g-streaming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246880305,"owners_count":20848840,"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":["http-flv","nginx","rtmp-server","streaming-server"],"created_at":"2024-08-01T12:00:53.476Z","updated_at":"2025-04-02T19:32:50.307Z","avatar_url":"https://github.com/dista.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Nginx G Streaming\n\nIt's a streaming server fork from ngx-rtmp-module.\n\nTested nginx version: `1.15.8`   \n\n## features\n* Orignal ngx-rtmp-module features\n* Http-flv live streaming output support\n  * standard http output, any http function that nginx already has can be used(such as http2)\n  * same ref-count shared memory management, low memory usage\n  * http-flv play will trigger other rtmp module(such as relay), except live module\n  * gop cache for quick play start\n\n## Build\n\ngo (https://github.com/arut/nginx-rtmp-module) to find how to build.    \n    \ncd to NGINX source directory \u0026 run this:    \n```\n./configure --add-module=/path/to/nginx-rtmp-module\nmake\nmake install\n```\n\n## Config\n\n### http/flv output\n\nThe code implements this feature is contained in `ngx_rtmp_http_live_module.h` and\n`ngx_rtmp_http_live_module.c`.     \nThe original nginx rtmp code is not changed except a small modification for `ngx_rtmp_codec_module`: add a field `raw_meta`. We need it to build flv metadata.\n\nThe example config for using these module is like this\n```\nrtmp {\n    server {\n        listen 19350;\n\n        http_live_src mylive;\n\n        application myapp {\n            live on; \n            http_live on; \n        }   \n    }   \n}\n\nhttp {\n    server {\n        listen       8080;\n\n        location /myapp {\n            http_rtmp_live_dst mylive;\n            http_rtmp_live on;\n        }\n    }\n}\n```\n\n`http_rtmp_live_dst` and `http_live_src` are paired, for example:    \nWhen we visit a http/flv stream `http://127.0.0.1:8080/myapp/test.flv`, it will find rtmp server block contains the `http_live_src` as `mylive`, and find app `myapp` and stream name `test`.\nSo if we using ffmpeg to push rtmp stream to `rtmp://127.0.0.1:19350/myapp/test`,  the stream data will send to the http/flv client.\n\n## Directive\n\n#### http_live_src\nSyntax: `http_live_src name`    \nContext: server    \n    \nName a rtmp server block, when play using http/flv, `http_rtmp_live_dst` will try    \nto find this server block\n\n#### http_live\nSyntax: `http_live on|off`    \nContext: rtmp, server, app    \n    \nWhether enable http/flv live function\n\n#### http_wait_key\nSyntax: `http_wait_key on|off`    \nContext: rtmp, server, app    \n    \nWait for key-frame when output    \n\n#### http_wait_video\nSyntax: `http_wait_video on|off`    \nContext: rtmp, server, app    \n    \nWhen audio packet arrive first, drop it and wait for video    \n\n#### http_live_cache\nSyntax: `http_live_cache on|off`    \nContext: rtmp, server, app    \n    \nCache frame, so when a new player start to play, the cached frame will be sent first.    \nThis will make player start to play quickly.    \n\n#### http_rtmp_live_dst\nSyntax: `http_rtmp_live_dst name`    \nContext: http, server, location    \n        \nFind `http_live_src` server of the 'name', so we will get rtmp packet from that server block\n\n#### http_rtmp_live\nSyntax: `http_rtmp_live on|off`    \nContext: http, server, location    \n    \nEnable http/flv by convert from live rtmp stream publish.    \n\n### Try\n\npushing using ffmpeg\n\n```\nffmpeg -re -i $input_video_file_path -acodec copy -vcodec copy -flags global_header -f flv rtmp://127.0.0.1:19350/myapp/test\n```\n\ndownload(or play by any player, such as vlc)\n\n```\n➜  ~ curl http://127.0.0.1:8080/myapp/test.flv \u003e /dev/null\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100 1594k    0 1594k    0     0   114k      0 --:--:--  0:00:13 --:--:--  117k\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdista%2Fnginx-g-streaming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdista%2Fnginx-g-streaming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdista%2Fnginx-g-streaming/lists"}