{"id":3152,"date":"2017-03-27T11:58:44","date_gmt":"2017-03-27T03:58:44","guid":{"rendered":"http:\/\/blog.hoyo.idv.tw\/?p=3152"},"modified":"2017-05-08T13:36:20","modified_gmt":"2017-05-08T05:36:20","slug":"centos-6-7-%e5%ae%89%e8%a3%9d%e3%80%81%e4%bd%bf%e7%94%a8-simple-rtmp-server","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=3152","title":{"rendered":"CentOS 6.7 \u5b89\u88dd\u3001\u4f7f\u7528 Simple RTMP Server"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>\u4e0b\u8f09 for CentOS 6 \u9069\u5408\u5957\u4ef6<\/p>\n<ul>\n<li><a href=\"http:\/\/ossrs.net\/srs.release\/releases\/index.html\" target=\"_blank\">simple-rtmp-server<\/a>\u00a0(<a href=\"http:\/\/ossrs.net\/srs.release\/releases\/files\/SRS-CentOS6-x86_64-2.0.205.zip\">x86_64.zip<\/a>)<\/li>\n<\/ul>\n<p><strong>\u89e3\u58d3\u7e2e\u53ca\u5b89\u88dd<\/strong><\/p>\n<p>\u5c07 zip \u653e\u5230 CentOS \u5f8c<\/p>\n<pre class=\"lang:default decode:true\">unzip SRS-CentOS6-x86_64-2.0.205.zip\r\ncd SRS-CentOS6-x86_64-2.0.205\r\n.\/INSTALL<\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\u4f7f\u7528<\/p>\n<pre class=\"lang:default decode:true \">\/etc\/init.d\/srs restart<\/pre>\n<p>\u555f\u52d5 SRS \u670d\u52d9<\/p>\n<p>\u4e00\u822c\u4f86\u8aaa\u61c9\u8a72\u6703\u770b\u5230 LISTEN 1935 \u7684 RTMP Server<\/p>\n<pre class=\"lang:default decode:true\">[root@localhost:SRS-CentOS6-x86_64-2.0.205] # netstat -luntp\r\nActive Internet connections (only servers)\r\nProto Recv-Q Send-Q Local Address               Foreign Address             State       PID\/Program name   \r\ntcp        0      0 0.0.0.0:445                 0.0.0.0:*                   LISTEN      5397\/smbd           \r\ntcp        0      0 0.0.0.0:1985                0.0.0.0:*                   LISTEN      19077\/.\/objs\/srs    \r\ntcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      5256\/mysqld         \r\ntcp        0      0 0.0.0.0:139                 0.0.0.0:*                   LISTEN      5397\/smbd           \r\ntcp        0      0 0.0.0.0:11211               0.0.0.0:*                   LISTEN      5085\/memcached      \r\ntcp        0      0 0.0.0.0:1935                0.0.0.0:*                   LISTEN      19077\/.\/objs\/srs    \r\ntcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      4545\/rpcbind        \r\ntcp        0      0 0.0.0.0:8080                0.0.0.0:*                   LISTEN      19077\/.\/objs\/srs    \r\ntcp        0      0 0.0.0.0:56144               0.0.0.0:*                   LISTEN      4645\/rpc.statd      \r\ntcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      4698\/cupsd          \r\ntcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      5308\/sendmail       \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>--<\/p>\n<h2>\u767c\u9001 HLS \u8a0a\u865f\u6d41<\/h2>\n<p>\u53c3\u8003 conf\/http.hls.conf \u8a2d\u5b9a\uff0c\u4fee\u6539 conf\/srs.conf<\/p>\n<pre class=\"lang:default decode:true\"># main config for srs.\r\n# @see full.conf for detail config.\r\n\r\nlisten              1935;\r\nmax_connections     1000;\r\nsrs_log_tank        file;\r\nsrs_log_file        .\/objs\/srs.log;\r\nhttp_api {\r\n    enabled         on;\r\n    listen          1985;\r\n}\r\nhttp_server {\r\n    enabled         on;\r\n    listen          8080;\r\n    dir             .\/objs\/nginx\/html;\r\n}\r\nstats {\r\n    network         0;\r\n    disk            sda sdb xvda xvdb;\r\n}\r\nvhost __defaultVhost__ {\r\n    hls {\r\n        enabled         on;\r\n        hls_fragment    10;\r\n        hls_window      60;\r\n        hls_path        \/WEBSite\/ntuas\/WWW\/live;\r\n        hls_m3u8_file   [app]\/live.m3u8;\r\n        hls_ts_file     [app]\/[stream]-[seq].ts;\r\n    }\r\n}\r\n<\/pre>\n<p><strong>\u6709\u95dc HLS \u7684\u8a2d\u5b9a\u53ca\u610f\u7fa9<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/ossrs\/srs\/wiki\/v2_CN_DeliveryHLS\" target=\"_blank\">Delivery HLS<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>--<\/p>\n<h2>Android APP<\/h2>\n<ul>\n<li><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=air.tv.lotusfusion.rtmp.player.one&amp;hl=zh_TW\" target=\"_blank\">RTMP LIVE Stream Player<\/a>\u00a0\u64ad\u653e RTMP \u8a0a\u865f\u8996\u983b<\/li>\n<li><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.vaultmicro.camerafi.live&amp;hl=zh_TW\" target=\"_blank\">CameraFi Live<\/a>\u00a0\u5c07 Android \u88dd\u7f6e\u7684\u5f71\u97f3\u76f4\u64ad\u5230 RTMP Server<\/li>\n<li><a href=\"http:\/\/ossrs.net\/apks\/sea.latest.apk\" target=\"_blank\">srs-sea<\/a>\u00a0\u4f7f\u7528\u65bc\u00a0<a href=\"https:\/\/github.com\/ossrs\/srs\/wiki\/v2_CN_Streamer#push-http-flv-to-srs\" target=\"_blank\">Push HTTP FLV to SRS<\/a>\u00a0\u65b9\u5f0f<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>--<\/p>\n<h2>IOS APP<\/h2>\n<p>&nbsp;<\/p>\n<p>--<\/p>\n<h2>\u81ea\u7de8\u8b6f<\/h2>\n<pre class=\"lang:default decode:true \">cd \/tmp\r\ngit clone https:\/\/github.com\/wenjiegit\/srs\r\ncd srs\/trunk\r\n.\/configure<\/pre>\n<p>\u9810\u8a2d\u7de8\u8b6f\u529f\u80fd\u3001\u9078\u9805<\/p>\n<pre class=\"lang:default decode:true\">configure summary:\r\n      --x86-x64 \r\n      --prefix=\/usr\/local\/srs --with-hls --with-hds --with-dvr --without-nginx --with-ssl --without-ffmpeg --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --without-stream-caster --with-http-api --with-librtmp --without-research --with-utest --without-gperf --without-gmc --without-gmp --without-gcp --without-gprof --without-arm-ubuntu12 --without-mips-ubuntu12 --log-trace<\/pre>\n<p>\u5728\u6b64\u53e6\u5916\u589e\u52a0\u5e7e\u500b\u529f\u80fd<\/p>\n<ul>\n<li>--with-stream-caster<\/li>\n<\/ul>\n<p>--<\/p>\n<h2>\u4e86\u89e3 Server \u904b\u4f5c\u60c5\u6cc1<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/ossrs\/srs\/wiki\/v2_CN_HTTPApi\" target=\"_blank\">v2_CN_HTTPApi<\/a><\/li>\n<\/ul>\n<p>\u5730\u5740\u662f\uff1a<code>http:\/\/192.168.1.170:1985\/api\/v1<\/code>\uff0c\u4e3b\u8981\u5305\u542b\u7684\u5b50api\u6709\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>API<\/th>\n<th>Example<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>server<\/td>\n<td>4481<\/td>\n<td>\u670d\u52a1\u5668\u6807\u8bc6<\/td>\n<\/tr>\n<tr>\n<td>versions<\/td>\n<td>\/api\/v1\/versions<\/td>\n<td>\u83b7\u53d6\u670d\u52a1\u5668\u7248\u672c\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>summaries<\/td>\n<td>\/api\/v1\/summaries<\/td>\n<td>\u83b7\u53d6\u670d\u52a1\u5668\u7684\u6458\u8981\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>rusages<\/td>\n<td>\/api\/v1\/rusages<\/td>\n<td>\u83b7\u53d6\u670d\u52a1\u5668\u8d44\u6e90\u4f7f\u7528\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>self_proc_stats<\/td>\n<td>\/api\/v1\/self_proc_stats<\/td>\n<td>\u83b7\u53d6\u670d\u52a1\u5668\u8fdb\u7a0b\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>system_proc_stats<\/td>\n<td>\/api\/v1\/system_proc_stats<\/td>\n<td>\u83b7\u53d6\u670d\u52a1\u5668\u6240\u6709\u8fdb\u7a0b\u60c5\u51b5<\/td>\n<\/tr>\n<tr>\n<td>meminfos<\/td>\n<td>\/api\/v1\/meminfos<\/td>\n<td>\u83b7\u53d6\u670d\u52a1\u5668\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<\/td>\n<\/tr>\n<tr>\n<td>authors<\/td>\n<td>\/api\/v1\/authors<\/td>\n<td>\u83b7\u53d6\u4f5c\u8005\u3001\u7248\u6743\u548cLicense\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>features<\/td>\n<td>\/api\/v1\/features<\/td>\n<td>\u83b7\u53d6\u7cfb\u7edf\u652f\u6301\u7684\u529f\u80fd\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td>requests<\/td>\n<td>\/api\/v1\/requests<\/td>\n<td>\u83b7\u53d6\u8bf7\u6c42\u7684\u4fe1\u606f\uff0c\u5373\u5f53\u524d\u53d1\u8d77\u7684\u8bf7\u6c42\u7684\u8be6\u7ec6\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>vhosts<\/td>\n<td>\/api\/v1\/vhosts<\/td>\n<td>\u83b7\u53d6\u670d\u52a1\u5668\u4e0a\u7684vhosts\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>streams<\/td>\n<td>\/api\/v1\/streams<\/td>\n<td>\u83b7\u53d6\u670d\u52a1\u5668\u7684streams\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>clients<\/td>\n<td>\/api\/v1\/clients<\/td>\n<td>\u83b7\u53d6\u670d\u52a1\u5668\u7684clients\u4fe1\u606f\uff0c\u9ed8\u8ba4\u83b7\u53d6\u524d10\u4e2a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>--<\/p>\n<h2>HTTP API callback<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/ossrs\/srs\/wiki\/v2_CN_HTTPCallback\" target=\"_blank\">v2_CN_HTTPCallback<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/ossrs\/srs\/wiki\/v1_CN_DRM\" target=\"_blank\">v1_CN_DRM<\/a><\/li>\n<\/ul>\n<p>\u9810\u8a2d\u5167\u5efa HTTP Callback API Server<\/p>\n<pre class=\"lang:default decode:true \">cd \/tmp\/srs\/trunk\/research\/api-server\r\npython server.py 8085<\/pre>\n<p>\u5b98\u65b9 REST api \u8abf\u9069\u5de5\u5177<\/p>\n<ul>\n<li><a href=\"http:\/\/ossrs.net\/srs.release\/http-rest\/index.html\" target=\"_blank\">HTTP methods<\/a><\/li>\n<\/ul>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"3152\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;4,632&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u4e0b\u8f09 for C...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"3152\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;4,632&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[26],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3152"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3152"}],"version-history":[{"count":9,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3152\/revisions"}],"predecessor-version":[{"id":3184,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3152\/revisions\/3184"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}