{"id":88,"date":"2019-11-28T08:25:53","date_gmt":"2019-11-28T00:25:53","guid":{"rendered":"http:\/\/blog.yuekegu.com\/?p=88"},"modified":"2019-11-28T08:25:53","modified_gmt":"2019-11-28T00:25:53","slug":"php%e5%86%99%e5%9c%a8%e7%ba%bf%e8%a7%86%e9%a2%91%e7%9b%b4%e6%92%ad%e6%8a%80%e6%9c%af%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/book.yuekegu.com\/index.php\/2019\/11\/28\/php%e5%86%99%e5%9c%a8%e7%ba%bf%e8%a7%86%e9%a2%91%e7%9b%b4%e6%92%ad%e6%8a%80%e6%9c%af%e8%af%a6%e8%a7%a3\/","title":{"rendered":"PHP\u5199\u5728\u7ebf\u89c6\u9891\u76f4\u64ad\u6280\u672f\u8be6\u89e3"},"content":{"rendered":"\n<p>\u672c\u6587\u8f6c\u81ea\uff1ahttps:\/\/www.cnblogs.com\/zx-admin\/p\/5697447.html<\/p>\n\n\n\n<p>\u5e9f\u8bdd\u4e00\u53e5\uff0c\u5982\u679c\u4f60\u8981\u505a\u9ad8\u6027\u80fd\u670d\u52a1\u5668\u670d\u52a1\uff0c\u8bf7\u53bb\u8bfb\u5e95\u5c42\u7684\u4e1c\u897f http tcp\/ip socket \u4e86\u89e3\u57fa\u7840\u534f\u8bae\uff0c\u4f60\u5bf9\u5982\u4f55\u5efa\u9020\u9ad8\u6027\u80fd\u670d\u52a1\u5668\u4f1a\u6709\u4e00\u4e2a\u6df1\u5ea6\u7684\u4e86\u89e3<\/p>\n\n\n\n<p>\u76ee\u524d\u697c\u4e3b\u4e13\u6ce8php\u5f00\u53d1\uff0c\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u5c31\u662f\u4f7f\u7528lnmp\u53bb\u76f4\u63a5\u505a\uff0c\u641c\u7d22\u4ee5\u4e0b\u8d44\u6599\uff0c\u53d1\u73b0\u8fd8\u662f\u884c\u5f97\u901a\u7684\uff0c\u5148\u628a\u57fa\u7840\u67b6\u6784\u5217\u51fa\u6765<\/p>\n\n\n\n<p>\u524d\u7aef\u9875\u9762 php &nbsp;<\/p>\n\n\n\n<p>\u5f39\u5e55flash+js \u6570\u636e\u6765\u6e90\u662fredis\u96c6\u7fa4 &nbsp;<\/p>\n\n\n\n<p>\u53ca\u65f6\u804a\u5929 redis\u96c6\u7fa4 +js\u957f\u8fde\u63a5<\/p>\n\n\n\n<p>\u793c\u7269\u7cfb\u7edf&nbsp;<\/p>\n\n\n\n<p>\u5728\u7ebf\u8c03\u7528ffmpeg\u5bf9\u6d41\u5a92\u4f53\u8fdb\u884c\u8f6c\u7801<\/p>\n\n\n\n<p>\u670d\u52a1\u5668\u6d41\u5a92\u4f53&nbsp;nginx-rtmp-module &nbsp;\u7684\u652f\u6301<\/p>\n\n\n\n<p>\u57fa\u4e8eHTTP\u7684FLV\/MP4 VOD\u70b9\u64ad<br>HLS (HTTP Live Streaming) M3U8\u7684\u652f\u6301<br>\u57fa\u4e8ehttp\u7684\u64cd\u4f5c\uff08\u53d1\u5e03\u3001\u64ad\u653e\u3001\u5f55\u5236\uff09<br>\u53ef\u4ee5\u5f88\u597d\u7684\u534f\u540c\u73b0\u6709\u7684\u6d41\u5a92\u4f53\u670d\u52a1\u5668\u4ee5\u53ca\u64ad\u653e\u5668\u4e00\u8d77\u5de5\u4f5c<br>\u5728\u7ebf\u8c03\u7528ffmpeg\u5bf9\u6d41\u5a92\u4f53\u8fdb\u884c\u8f6c\u7801<br>H264\/AAC\u97f3\u89c6\u9891\u7f16\u7801\u683c\u5f0f\u7684\u652f\u6301<br><\/p>\n\n\n\n<p>\u670d\u52a1\u5668\u7aef\u7684\u5e76\u53d1\u548c\u8d1f\u8f7d\u662f\u5f88\u5927\u7684\u95ee\u9898\uff0c\u5728\u517c\u987e\u670d\u52a1\u5668\u6570\u91cf+\u5bbd\u5e26\u7684\uff0c\u540e\u9762\u5728\u8be6\u89e3<\/p>\n\n\n\n<p>\u89c6\u9891\u52a0\u901f cdn<\/p>\n\n\n\n<p>\u652f\u6301\u7684pc \u5b89\u5353 ios\u9700\u8981\u4f18\u5316 \u56e0\u4e3a&nbsp;nginx-rtmp\u4e5f\u662f\u652f\u6301HLS&nbsp;<\/p>\n\n\n\n<p>\u89c6\u9891\u6e90\u652f\u6301 obs \u76ee\u524d\u8fd9\u4e2a\u662fpc\u5f00\u6e90\u7684\u6bd4\u8f83\u597d\u7684<\/p>\n\n\n\n<p>\u5b89\u5353\u6216\u8005ios\u76ee\u524d\u6ca1\u6709\u53d1\u73b0\u6bd4\u8f83\u597d\u7684\u5f00\u6e90\u89c6\u9891\u6e90\u63a8\u9001\u7684\uff0c\u6b22\u8fce\u63a8\u8350<\/p>\n\n\n\n<p>\u80cc\u666f\u548c\u8d44\u6599<\/p>\n\n\n\n<p>\u76ee\u524d\u6d41\u884c\u7684\u6d41\u5a92\u4f53\u670d\u52a1\u5668<\/p>\n\n\n\n<p><a href=\"http:\/\/www.oschina.net\/project\/tag\/111\/streaming\">http:\/\/www.oschina.net\/project\/tag\/111\/streaming<\/a><\/p>\n\n\n\n<p>\u8fdb\u884c\u7efc\u5408\u5bf9\u6bd4\uff0c\u53d1\u73b0\u5c31PHP\u4f5c\u4e3a\u5f00\u53d1\u8bed\u8a00\u6765\u8bf4\uff0cnginx\u80af\u5b9a\u662f\u6bd4\u8f83\u65b9\u4fbf\uff0c\u56e0\u4e3a\u5927\u90e8\u5206\u9700\u8981\u7684\u4e1c\u897f\u90fd\u53ef\u4ee5\u76f4\u63a5\u914d\u7f6e\u800c\u4e14\u914d\u7f6e\u4e5f\u4e0d\u662f\u5f88\u9ebb\u70e6<\/p>\n\n\n\n<p>\u53c8\u82b1\u4e86\u5f88\u591a\u65f6\u95f4\u53bb\u641c\u7d22\u6027\u80fd\u5bf9\u6bd4\uff0c\u53d1\u73b0nginx-rtmp\u7684\u6027\u80fd\u8fd8\u662f\u4e0d\u9519\u7684\uff0c\u800c\u4e14\u540e\u671f\u505a\u8d1f\u8f7d\u548c\u6c34\u5e73\u6269\u5c55\uff0c\u90fd\u662f\u5f88\u65b9\u4fbf\u7684<\/p>\n\n\n\n<p>\u5f00\u53d1\u6587\u6863<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/arut\/nginx-rtmp-module\/wiki\/Directives\">https:\/\/github.com\/arut\/nginx-rtmp-module\/wiki\/Directives<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/blog.csdn.net\/defonds\/article\/details\/9274479\/\">http:\/\/blog.csdn.net\/defonds\/article\/details\/9274479\/<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/blog.csdn.net\/cccallen\/article\/details\/8440191\/\">http:\/\/blog.csdn.net\/cccallen\/article\/details\/8440191\/<\/a><\/p>\n\n\n\n<p>\u6240\u4ee5\u6700\u540e\u51b3\u5b9a\u662fnginx-rtmp\u4f5c\u4e3a\u6d41\u5a92\u4f53\u670d\u52a1\u5668\uff0c\u6570\u636e\u5e93\u4e0a5.6+\u56e0\u4e3a5.6+\u7684\u7248\u672c\u628a\u4e3b\u4ece\u7684\u65e5\u5fd7\u590d\u5236\u53d8\u6210\u4e86\u591a\u7ebf\u7a0b\u590d\u5236\uff0c\u6027\u80fd\u66f4\u597d\uff0c\u914d\u7f6e\u66f4\u65b9\u4fbf<\/p>\n\n\n\n<p><a href=\"http:\/\/www.ttlsa.com\/mysql\/summary-of-the-new-features-of-mysql5_6\/\">http:\/\/www.ttlsa.com\/mysql\/summary-of-the-new-features-of-mysql5_6\/<\/a><\/p>\n\n\n\n<p>\u5efa\u8bae\u4e0a5.7&nbsp;QPS \u66f4\u5f3a\uff0c\u6700\u65b0\u7248\uff0c\u56e0\u4e3a\u662f\u5168\u65b0\u9879\u76ee\uff0c\u7f16\u8bd1 \u7684\u65f6\u5019\u53ef\u4ee5\u628a&nbsp;memory\u5b58\u50a8\u5f15\u64ce\u52a0\u4e0a\uff0c\u5728\u6d4b\u8bd5\u670d\u5728\u6d4b\u8bd5\u6bd4\u8f83\u65b9\u4fbf<\/p>\n\n\n\n<p>&nbsp;5.7\u7248\u672c\u65b0\u7279\u6027\u8bf4\u660e<\/p>\n\n\n\n<p><a href=\"http:\/\/www.oschina.net\/translate\/whats-new-in-mysql-5-7-generally-available?cmp&amp;p=4\">http:\/\/www.oschina.net\/translate\/whats-new-in-mysql-5-7-generally-available?cmp&amp;p=4<\/a><\/p>\n\n\n\n<p>\u4f5c\u4e3a\u9700\u8981\u9ad8\u5e76\u53d1\u7684\u7f51\u7ad9\uff0c\u5efa\u8bae\u6700\u597d\u4e0aphp7\uff0c\u56e0\u4e3a\u5b98\u65b9\u9e1f\u54e5\u65e9\u5c31\u8bf4\u4e86\uff0c\u6027\u80fd\u589e\u52a030\n\n\n\n<p>php\u7684\u5e76\u53d1\u6269\u5c55\u6765\u8bf4\uff0c\u591a\u8fdb\u7a0b\uff0c\u867d\u7136\u4e5f\u6709\u591a\u7ebf\u7a0b\uff0c\u4f46\u662f7\u4ee5\u4e0a\u7684\u7248\u672c\u7684\u6269\u5c55\u4e0d\u77e5\u9053\u662f\u5426\u5df2\u7ecf\u66f4\u65b0\uff0c\u8fd9\u4e2a\u4e5f\u662f\u4e2a\u95ee\u9898\uff0c\u5982\u679c\u4f60\u4e86\u89e3go\u8bed\u8a00\u5c31\u4f1a\u53d1\u73b0go\u5728\u5e76\u53d1\u65b9\u9762\u505a\u5f97\u5f88\u597d<\/p>\n\n\n\n<p>\u534f\u7a0b\u6bd4\u591a\u7ebf\u7a0b\u7684\u8d44\u6e90\u6d88\u8017\u66f4\u5c0f\uff0c\u800c\u4e14nginx\u4e5f\u662f\u652f\u6301go\u7684\uff0c\u4f46\u662f\u6027\u80fd\u600e\u4e48\u6837\uff0c\u76ee\u524d\u6ca1\u6709\u6d4b\u8bd5\u8fc7&nbsp;<\/p>\n\n\n\n<p><a href=\"http:\/\/blog.csdn.net\/win_lin\/article\/details\/41379799\">http:\/\/blog.csdn.net\/win_lin\/article\/details\/41379799<\/a><\/p>\n\n\n\n<p>\u5185\u5b58\u6570\u636e\u5e93\u76ee\u524d\u5927\u90e8\u5206\u90fd\u662fredis\u96c6\u7fa4\uff0c\u6211\u4e5f\u662f\u9009\u7684\u8fd9\u4e2a<\/p>\n\n\n\n<p>\u6574\u4f53\u4e0b\u6765\u4f5c\u4e3a\u4e00\u4e2aphp\u6765\u8bf4\uff0c\u8fd9\u6837\u7684\u5f00\u53d1\u6210\u672c\u662f\u6700\u4f4e\u7684<\/p>\n\n\n\n<p>&nbsp;\u76ee\u524d\u57fa\u4e8ephp7\u7684\u6846\u67b6\u76ee\u524d\u6ca1\u6709\uff0c\u6240\u793a\u81ea\u5df1\u5f00\u53d1\u4e00\u4e2a\u5c0f\u7684\u8026\u5408\u6027\u4f4e\uff0c\u65b9\u4fbf\u53ef\u4ee5\u6269\u5c55\u7684\u6807\u51c6mvc\u6846\u67b6\uff0c\u6a21\u4effCI\uff0c\u76ee\u524d3.X\u7cfb\u5217\u6ca1\u6709\u8bf4\u660e\u652f\u6301php7<\/p>\n\n\n\n<p>\u636e\u8bf4CI 4 .x\u7248\u672c\u4f1a\u652f\u6301<\/p>\n\n\n\n<p><a href=\"http:\/\/codeigniter.org.cn\/forums\/thread-22318-1-1.html\">http:\/\/codeigniter.org.cn\/forums\/thread-22318-1-1.html<\/a><\/p>\n\n\n\n<p>\u7f51\u7ad9\u5f00\u53d1\u6d4b\u8bd5<\/p>\n\n\n\n<p>&nbsp;\u6d4b\u8bd5\u670d\u642d\u5efa<\/p>\n\n\n\n<p>vmware<\/p>\n\n\n\n<p>\u670d\u52a1\u5668 centos 6.5 \u548c&nbsp;centos 7.2<\/p>\n\n\n\n<p>php7.1 mysql 5.7 nginx 1.9<\/p>\n\n\n\n<p>\u7ec4\u4ef6\u57fa\u672c\u90fd\u662f\u6700\u65b0\u7248<\/p>\n\n\n\n<p><br>user nginx;<br>worker_processes 1;<\/p>\n\n\n\n<p>#error_log logs\/error.log;<br>#error_log logs\/error.log notice;<br>#error_log logs\/error.log info;<\/p>\n\n\n\n<p>#pid logs\/nginx.pid;<\/p>\n\n\n\n<p><br>events {<br>worker_connections 10240;<br>}<\/p>\n\n\n\n<p>rtmp_auto_push on;<br>rtmp_auto_push_reconnect 1s;<\/p>\n\n\n\n<p><br>rtmp {<br>server {<br>listen 1935;<\/p>\n\n\n\n<p>application mytv { &nbsp;\/\/\u5343\u4e07\u4e0d\u80fd\u4f7f\u7528myapp\u4f5c\u4e3a\u540d\u5b57 \uff0c\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u5c31\u662f\u59cb\u7ec8\u65e0\u6cd5\u64ad\u653e \u8bbf\u95ee\u8def\u5f84\u662frtmp:\/\/ip\/mytv\/ \u53ef\u4ee5\u4f7f\u7528vlc\u64ad\u653e\u5668\u64ad\u653e\uff0c\u4f5c\u4e3a\u6d4b\u8bd5<br>live on;<br>}<\/p>\n\n\n\n<p><br>application hls {<br>live on;<br>hls on;<br>hls_path \/usr\/local\/nginx\/hls; \u00a0\/\/\u8fd9\u4e2a\u5730\u5740\u6700\u597d\u548c<br>hls_fragment 5s;\u00a0<br>}<br>}<br>}<\/p>\n\n\n\n<p>http {<br>include mime.types;<br>default_type application\/octet-stream;<\/p>\n\n\n\n<p><br>sendfile on;<\/p>\n\n\n\n<p>access_log on;&nbsp;<br>access_log \/usr\/local\/nginx\/html\/rtmp_access.log;<\/p>\n\n\n\n<p><br>server {<br>listen 8081;<br>server_name localhost 192.168.1.70 127.0.0.1;<\/p>\n\n\n\n<p><br>location \/hls {<br>types {<br>application\/vnd.apple.mpegurl m3u8; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u8bf7\u6ce8\u610f\u662f\u52a0\u4e0aon_public url\/x.php \u5728\u8fd9\u4e2aphp\u6587\u4ef6\u505a\u6743\u9650\u548cid\u5bf9\u5e94\u64ad\u653e\u623f\u95f4\u7684\u5224\u65ad\uff0c\u662f\u6839\u636e\u4f20\u5165\u7684id\u8fdb\u884c\u751f\u4ea7id.m3u8\u6587\u4ef6\u7684<br>video\/mp2t ts; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\u8bbf\u95eeurl\u662fhttp:\/\/ip\/id.m3u8<br>}<br>root \/usr\/local\/nginx\/hls;<br>}<br><\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>server {<\/p>\n\n\n\n<p>listen 8080;<br>location \/stat {<\/p>\n\n\n\n<p>rtmp_stat all;<\/p>\n\n\n\n<p>rtmp_stat_stylesheet stat.xsl;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>location \/stat.xsl {<\/p>\n\n\n\n<p>root \/usr\/local\/nginx\/html\/; #\u5728nginx-rtmp-module\u6e90\u7801\u6839\u76ee\u5f55 &nbsp; \u67e5\u770b\u5f53\u524d\u670d\u52a1\u5668\u63a8\u6d41\u60c5\u51b5\u7684xsl\u7edf\u8ba1<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>server {<\/p>\n\n\n\n<p>listen 8082;<br>location \/ {<\/p>\n\n\n\n<p>root \/usr\/local\/nginx\/html\/;<\/p>\n\n\n\n<p>}<br>}<\/p>\n\n\n\n<p>server {<\/p>\n\n\n\n<p>listen 80;<br>location \/ {<\/p>\n\n\n\n<p>root \/usr\/local\/nginx\/html\/;<\/p>\n\n\n\n<p>}<br>}<br>}<\/p>\n\n\n\n<p><br>user nginx;<br>worker_processes 1;<\/p>\n\n\n\n<p>#error_log logs\/error.log;<br>#error_log logs\/error.log notice;<br>#error_log logs\/error.log info;<\/p>\n\n\n\n<p>#pid logs\/nginx.pid;<\/p>\n\n\n\n<p><br>events {<br>worker_connections 10240;<br>}<\/p>\n\n\n\n<p>rtmp_auto_push on;<br>rtmp_auto_push_reconnect 1s;<\/p>\n\n\n\n<p><br>rtmp {<br>server {<br>listen 1935;<\/p>\n\n\n\n<p>application mytv { &nbsp;\/\/\u5343\u4e07\u4e0d\u80fd\u4f7f\u7528myapp\u4f5c\u4e3a\u540d\u5b57 \uff0c\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u5c31\u662f\u59cb\u7ec8\u65e0\u6cd5\u64ad\u653e \u8bbf\u95ee\u8def\u5f84\u662frtmp:\/\/ip\/mytv\/ \u53ef\u4ee5\u4f7f\u7528vlc\u64ad\u653e\u5668\u64ad\u653e\uff0c\u4f5c\u4e3a\u6d4b\u8bd5<br>live on;<br>}<\/p>\n\n\n\n<p><br>application hls {<br>live on;<br>hls on;<br>hls_path \/usr\/local\/nginx\/hls; \u00a0\/\/\u8fd9\u4e2a\u5730\u5740\u6700\u597d\u548c<br>hls_fragment 5s;\u00a0<br>}<br>}<br>}<\/p>\n\n\n\n<p>http {<br>include mime.types;<br>default_type application\/octet-stream;<\/p>\n\n\n\n<p><br>sendfile on;<\/p>\n\n\n\n<p>access_log on;&nbsp;<br>access_log \/usr\/local\/nginx\/html\/rtmp_access.log;<\/p>\n\n\n\n<p><br>server {<br>listen 8081;<br>server_name localhost 192.168.1.70 127.0.0.1;<\/p>\n\n\n\n<p><br>location \/hls {<br>types {<br>application\/vnd.apple.mpegurl m3u8; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u8bf7\u6ce8\u610f\u662f\u52a0\u4e0aon_public url\/x.php \u5728\u8fd9\u4e2aphp\u6587\u4ef6\u505a\u6743\u9650\u548cid\u5bf9\u5e94\u64ad\u653e\u623f\u95f4\u7684\u5224\u65ad\uff0c\u662f\u6839\u636e\u4f20\u5165\u7684id\u8fdb\u884c\u751f\u4ea7id.m3u8\u6587\u4ef6\u7684<br>video\/mp2t ts; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\u8bbf\u95eeurl\u662fhttp:\/\/ip\/id.m3u8<br>}<br>root \/usr\/local\/nginx\/hls;<br>}<br><\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>server {<\/p>\n\n\n\n<p>listen 8080;<br>location \/stat {<\/p>\n\n\n\n<p>rtmp_stat all;<\/p>\n\n\n\n<p>rtmp_stat_stylesheet stat.xsl;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>location \/stat.xsl {<\/p>\n\n\n\n<p>root \/usr\/local\/nginx\/html\/; #\u5728nginx-rtmp-module\u6e90\u7801\u6839\u76ee\u5f55 &nbsp; \u67e5\u770b\u5f53\u524d\u670d\u52a1\u5668\u63a8\u6d41\u60c5\u51b5\u7684xsl\u7edf\u8ba1<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>server {<\/p>\n\n\n\n<p>listen 8082;<br>location \/ {<\/p>\n\n\n\n<p>root \/usr\/local\/nginx\/html\/;<\/p>\n\n\n\n<p>}<br>}<\/p>\n\n\n\n<p>server {<\/p>\n\n\n\n<p>listen 80;<br>location \/ {<\/p>\n\n\n\n<p>root \/usr\/local\/nginx\/html\/;<\/p>\n\n\n\n<p>}<br>}<br>}<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;&nbsp;\u7f51\u9875\u6d4b\u8bd5\u64ad\u653e\u5668hls\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528h5\u76f4\u63a5\u64ad\u653e<\/pre>\n\n\n\n<p>rtmp\u53ef\u4ee5\u4f7f\u7528 ckplayer\u7684flash\u8fdb\u884c\u64ad\u653e\uff0c\u5b89\u5353\u624b\u673a\u7aef\u76ee\u524d\u6ca1\u6709\u6d4b\u8bd5\uff0c\u56e0\u4e3a\u624b\u673auc\u9ed8\u8ba4\u662f\u6ca1\u6709flash\uff0c\u4f46\u662f\u4f7f\u7528hls\u5c31\u53ef\u4ee5\uff0c\u56e0\u4e3aios\u9ed8\u8ba4\u5c31\u662f\u652f\u6301\u7684<\/p>\n\n\n\n<p>obs \u63a8\u6d41\u5730\u5740 \uff1artmp:\/\/ip\/mytv\/ \u64ad\u653e\u4e5f\u662f\u8fd9\u4e2a&nbsp;<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u4f1a\u518d\u6b21\u66f4\u65b0\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/configure \\\n--prefix=\/usr\/local\/nginx \\\n--add-module=\/usr\/local\/src\/nginx-rtmp-module-master \\\n--sbin-path=\/usr\/sbin\/nginx \\\n--conf-path=\/etc\/nginx\/nginx.conf \\\n--error-log-path=\/var\/log\/nginx\/error.log \\\n--http-log-path=\/var\/log\/nginx\/access.log \\\n--pid-path=\/var\/run\/nginx\/nginx.pid \\\n--lock-path=\/var\/lock\/nginx.lock \\\n--user=nginx \\\n--group=nginx \\\n--with-http_ssl_module \\\n--with-http_flv_module \\\n--with-http_stub_status_module \\\n--with-http_gzip_static_module \\\n--http-client-body-temp-path=\/var\/tmp\/nginx\/client\/ \\\n--http-proxy-temp-path=\/var\/tmp\/nginx\/proxy\/ \\\n--http-fastcgi-temp-path=\/var\/tmp\/nginx\/fcgi\/<br>\u8fd9\u4e2a\u7f16\u8bd1\u5176\u5b9e\u5df2\u7ecf\u628ahls\u5305\u542b\u8fdb\u53bb\u4e86<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"javascript:void(0);\"><img decoding=\"async\" src=\"https:\/\/common.cnblogs.com\/images\/copycode.gif\" alt=\"\u590d\u5236\u4ee3\u7801\"\/><\/a><\/figure>\n\n\n\n<p>&nbsp;2016\u5e748\u670816\u65e516:46:20 &nbsp;\u4eca\u5929\u4e0b\u5348\u6d4b\u8bd5\uff0c\u4f7f\u7528\u817e\u8baf\u4e91\u4f5c\u4e3a\u670d\u52a1\u5668\u7aef\u7684\uff0crtmp\u6d4b\u8bd5\u6548\u679c\u5ef6\u8fdf6-10s\uff0c\u672c\u5730\u4e32\u6d41\u5230\u670d\u52a1\u5668\uff0chls\u8fd8\u6ca1\u6709\u6d4b\u8bd5<\/p>\n\n\n\n<p>\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\u5c31\u662f\u817e\u8baf\u4e91\u7684\u5b89\u5168\u7ec4\uff0c\u4f60\u9700\u8981\u628a\u4f60\u7684\u673a\u5668\u52a0\u5165\u5f00\u653e\u6240\u6709\u7aef\u53e3\uff0c\u9ed8\u8ba4\u53ea\u5f00\u653e80\u7aef\u53e3\uff0c\u53ef\u4ee5\u76f4\u63a5IP\u8bbf\u95ee<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"javascript:void(0);\"><img decoding=\"async\" src=\"https:\/\/common.cnblogs.com\/images\/copycode.gif\" alt=\"\u590d\u5236\u4ee3\u7801\"\/><\/a><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">user  nginx;\nworker_processes  1;\n\n#error_log  logs\/error.log;\n#error_log  logs\/error.log  notice;\n#error_log  logs\/error.log  info;\n\n#pid        logs\/nginx.pid;\n\n\nevents {\n    worker_connections  10240;\n}\n\n   rtmp_auto_push on;\n   rtmp_auto_push_reconnect 1s;\n\n\nrtmp {\n    server {\n      listen 1935;\n\n      application mytv {\n           live on;\n      }\n\n         \n   application hls {\n            live on;\n            hls on;\n            hls_path \/usr\/local\/nginx\/hls;\n            hls_fragment 5s; \n        }\n   }\n}\n\nhttp {\n    include       mime.types;\n    default_type  application\/octet-stream;\n\n\n    sendfile        on;\n\n    access_log on;   \n          \n    access_log \/usr\/local\/nginx\/html\/rtmp_access.log;\n\n\n    server {\n        listen       8081;\n        server_name  localhost 192.168.1.170 127.0.0.1;\n\n\n        location \/hls {\n            \n            types {\n               # application\/vnd.apple.mpegurl m3u8;\n            application\/x-mpegurl m3u8;\n                video\/mp2t ts;\n            }\n            alias \/usr\/local\/nginx\/hls;\n            \n        }\n    \n\n    }\n\n\n\n    server {\n\n       listen      8080;\n       location \/stat {\n\n       rtmp_stat all;\n\n       rtmp_stat_stylesheet stat.xsl;\n\n       }\n\n \n\n       location \/stat.xsl {\n\n           root \/usr\/local\/nginx\/html\/;  #\u5728nginx-rtmp-module\u6e90\u7801\u6839\u76ee\u5f55\n\n       }\n\n   }\n\n\n\n\n\n server {\n\n       listen      80;\n       server_name  localhost 192.168.1.170 127.0.0.1;\n       location \/ {\n\n         root \/usr\/local\/nginx\/html\/;\n         index index.php;\n       }\n\n         location ~ \\.php$ {\n            root           \/usr\/local\/nginx\/html\/;\n            fastcgi_pass   127.0.0.1:9000;\n            fastcgi_index  index.php;\n            #fastcgi_param  SCRIPT_FILENAME  \/scripts$fastcgi_script_name;\n         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;\n            include        fastcgi_params;\n        }\n\n\n   }\n}<\/pre>\n\n\n\n<p>&nbsp;\u64ad\u653e\u5730\u5740&nbsp;http:\/\/192.168.1.170:8081\/hls\/.m3u8<\/p>\n\n\n\n<p>\u5b9e\u9645\u5f00\u53d1\u5c31\u4f1a\u6839\u636e\u7528\u6237ID.m3u8 \u6765\u64ad\u653e\uff0c\u6240\u4ee5\u9700\u8981\u4e00\u4e9bnginx\u7684\u77e5\u8bc6\uff0c\u63a8\u6d41\u5730\u5740 &nbsp;rtmp:\/\/192.168.1.170\/hls\/ &nbsp;\u5728\u52a0\u5bc6\u7684\u4e32\u6d41\u7801 \u91cc\u9762\u5e26\u4e0a\u7528\u6237ID\uff0c\u662f\u5426\u662f\u5927\u4e3b\u64ad\uff0c\u7b49\u7b49\u7684\u6807\u8bc6\uff0c\u6765\u5206\u6d41\u670d\u52a1\u5668\uff0cpull push cdn\u7b49<\/p>\n\n\n\n<p>\u6240\u4ee5nginx\u548cnginx-rtmp\u7684\u8be6\u7ec6\u77e5\u8bc6\u5f88\u91cd\u8981QQ\u7fa4&nbsp;247823727&nbsp;\u535a\u5ba2\u6587\u4ef6\u5982\u679c\u4e0d\u80fd\u4e0b\u8f7d\u8bf7\u8fdb\u7fa4\u4e0b\u8f7d&nbsp;\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u8f6c\u81ea\uff1ahttps:\/\/www.cnblogs.com\/zx-admin\/p\/5697447.html \u5e9f\u8bdd\u4e00\u53e5\uff0c\u5982\u679c\u4f60\u8981\u505a\u9ad8\u6027\u80fd\u670d\u52a1\u5668\u670d\u52a1\uff0c\u8bf7\u53bb\u8bfb\u5e95\u5c42\u7684\u4e1c\u897f http tcp\/ip socket \u4e86\u89e3\u57fa\u7840\u534f\u8bae\uff0c\u4f60\u5bf9\u5982\u4f55\u5efa\u9020\u9ad8\u6027\u80fd\u670d\u52a1\u5668\u4f1a\u6709\u4e00\u4e2a\u6df1\u5ea6\u7684\u4e86\u89e3 \u76ee\u524d\u697c\u4e3b\u4e13\u6ce8php\u5f00\u53d1\uff0c\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u5c31\u662f\u4f7f\u7528lnmp\u53bb\u76f4\u63a5\u505a\uff0c\u641c\u7d22\u4ee5\u4e0b\u8d44\u6599\uff0c\u53d1\u73b0\u8fd8\u662f\u884c\u5f97\u901a\u7684\uff0c\u5148\u628a\u57fa\u7840\u67b6\u6784\u5217\u51fa\u6765 \u524d\u7aef\u9875\u9762 php &nbsp; \u5f39\u5e55flash+js \u6570\u636e\u6765\u6e90\u662fredis\u96c6\u7fa4 &nbsp; \u53ca\u65f6\u804a\u5929 redis\u96c6\u7fa4 +js\u957f\u8fde\u63a5 \u793c\u7269\u7cfb\u7edf&nbsp; \u5728\u7ebf\u8c03\u7528ffmpeg\u5bf9\u6d41\u5a92\u4f53\u8fdb\u884c\u8f6c\u7801 \u670d\u52a1\u5668\u6d41\u5a92\u4f53&nbsp;nginx-rtmp-module &nbsp;\u7684\u652f\u6301 \u57fa\u4e8eHTTP\u7684FLV\/MP4 VOD\u70b9\u64adHLS (HTTP Live Streaming) M3U8\u7684\u652f\u6301\u57fa\u4e8ehttp\u7684\u64cd\u4f5c\uff08\u53d1\u5e03\u3001\u64ad\u653e\u3001\u5f55\u5236\uff09\u53ef\u4ee5\u5f88\u597d\u7684\u534f\u540c\u73b0\u6709\u7684\u6d41\u5a92\u4f53\u670d\u52a1\u5668\u4ee5\u53ca\u64ad\u653e\u5668\u4e00\u8d77\u5de5\u4f5c\u5728\u7ebf\u8c03\u7528ffmpeg\u5bf9\u6d41\u5a92\u4f53\u8fdb\u884c\u8f6c\u7801H264\/AAC\u97f3\u89c6\u9891\u7f16\u7801\u683c\u5f0f\u7684\u652f\u6301 \u670d\u52a1\u5668\u7aef\u7684\u5e76\u53d1\u548c\u8d1f\u8f7d\u662f\u5f88\u5927\u7684\u95ee\u9898\uff0c\u5728\u517c\u987e\u670d\u52a1\u5668\u6570\u91cf+\u5bbd\u5e26\u7684\uff0c\u540e\u9762\u5728\u8be6\u89e3 \u89c6\u9891\u52a0\u901f cdn \u652f\u6301\u7684pc \u5b89\u5353 ios\u9700\u8981\u4f18\u5316 \u56e0\u4e3a&nbsp;nginx-rtmp\u4e5f\u662f\u652f\u6301HLS&nbsp; \u89c6\u9891\u6e90\u652f\u6301 obs \u76ee\u524d\u8fd9\u4e2a\u662fpc\u5f00\u6e90\u7684\u6bd4\u8f83\u597d\u7684 \u5b89\u5353\u6216\u8005ios\u76ee\u524d\u6ca1\u6709\u53d1\u73b0\u6bd4\u8f83\u597d\u7684\u5f00\u6e90\u89c6\u9891\u6e90\u63a8\u9001\u7684\uff0c\u6b22\u8fce\u63a8\u8350 \u80cc\u666f\u548c\u8d44\u6599 \u76ee\u524d\u6d41\u884c\u7684\u6d41\u5a92\u4f53\u670d\u52a1\u5668 http:\/\/www.oschina.net\/project\/tag\/111\/streaming \u8fdb\u884c\u7efc\u5408\u5bf9\u6bd4\uff0c\u53d1\u73b0\u5c31PHP\u4f5c\u4e3a\u5f00\u53d1\u8bed\u8a00\u6765\u8bf4\uff0cnginx\u80af\u5b9a\u662f\u6bd4\u8f83\u65b9\u4fbf\uff0c\u56e0\u4e3a\u5927\u90e8\u5206\u9700\u8981\u7684\u4e1c\u897f\u90fd\u53ef\u4ee5\u76f4\u63a5\u914d\u7f6e\u800c\u4e14\u914d\u7f6e\u4e5f\u4e0d\u662f\u5f88\u9ebb\u70e6 \u53c8\u82b1\u4e86\u5f88\u591a\u65f6\u95f4\u53bb\u641c\u7d22\u6027\u80fd\u5bf9\u6bd4\uff0c\u53d1\u73b0nginx-rtmp\u7684\u6027\u80fd\u8fd8\u662f\u4e0d\u9519\u7684\uff0c\u800c\u4e14\u540e\u671f\u505a\u8d1f\u8f7d\u548c\u6c34\u5e73\u6269\u5c55\uff0c\u90fd\u662f\u5f88\u65b9\u4fbf\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-88","post","type-post","status-publish","format-standard","hentry","category-22"],"_links":{"self":[{"href":"https:\/\/book.yuekegu.com\/index.php\/wp-json\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/book.yuekegu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/book.yuekegu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/book.yuekegu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/book.yuekegu.com\/index.php\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":0,"href":"https:\/\/book.yuekegu.com\/index.php\/wp-json\/wp\/v2\/posts\/88\/revisions"}],"wp:attachment":[{"href":"https:\/\/book.yuekegu.com\/index.php\/wp-json\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/book.yuekegu.com\/index.php\/wp-json\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/book.yuekegu.com\/index.php\/wp-json\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}