{"id":1498,"date":"2021-01-20T13:53:40","date_gmt":"2021-01-20T05:53:40","guid":{"rendered":"http:\/\/123.57.164.21\/?p=1498"},"modified":"2021-02-27T14:28:35","modified_gmt":"2021-02-27T06:28:35","slug":"%e5%88%a9%e7%94%a8nginx-http-flv-module%e6%90%ad%e5%bb%ba%e8%a7%86%e9%a2%91%e7%82%b9%e6%92%ad%e6%9c%8d%e5%8a%a1%ef%bc%88%e9%9d%9edocker%e5%ae%89%e8%a3%85%ef%bc%89","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=1498","title":{"rendered":"\u5229\u7528nginx-http-flv-module\u642d\u5efa\u89c6\u9891\u70b9\u64ad\u670d\u52a1\uff08\u975eDocker\u5b89\u88c5\uff09"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2021\/01\/image-49-1024x584.png\" alt=\"\" class=\"wp-image-1509\" width=\"511\" height=\"283\"\/><figcaption>\u89c6\u9891\u70b9\u64ad\u670d\u52a1\u67b6\u6784<\/figcaption><\/figure><\/div>\n\n\n\n<p>\u8fd9\u4e2a\u67b6\u6784\u5728IOS\u7aef\u5229\u7528\uff0cLFliveKit\u63a8\u6d41\u5230nginx\u670d\u52a1\u5668\uff0c\u751f\u6210flv\u6587\u4ef6\u3002\u76f4\u64ad\u7ed3\u675f\u7136\u540e\u5229\u7528yamid\u5bf9FLV\u6587\u4ef6\u52a0\u5173\u952e\u5e27\uff0c\u5e76\u628a\u52a0\u5de5\u540e\u7684\u6587\u4ef6\u5728ngnix\u4e2d\uff0c\u4f5c\u4e3a\u9759\u6001\u8d44\u6e90\u516c\u5f00\u51fa\u6765\u3002\u5728web\u7aefhtml\u4e2d\u5229\u7528bilibili .js\u6765\u64ad\u653eflv\u89c6\u9891\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1.\u4e0b\u8f7dnginx\u548cnginx-http-flv-module\u6700\u65b0\u4ee3\u7801\u3002<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">nginx\u5b98\u7f51:<a href=\"http:\/\/nginx.org\/en\/download.html\">http:\/\/nginx.org\/en\/download.html<\/a>\nnginx-http-flv-module:<a href=\"https:\/\/github.com\/winshining\/nginx-http-flv-module\">https:\/\/github.com\/winshining\/nginx-http-flv-module<\/a><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. \u5f00\u59cb\u5b89\u88c5nginx \u548c nginx-http-flv-module<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1.\u4e0b\u8f7dnginx\u6e90\u7801\n  wget http:\/\/nginx.org\/download\/nginx-1.19.6.tar.gz\n\n2.\u4e0b\u8f7dnginx-http-flv-module\n  git clone https:\/\/github.com\/winshining\/nginx-http-flv-module.git\n  \u8fd9\u91cc\u9700\u8981git\uff0c \u5982\u679c\u6ca1\u5b89\u88c5git\u7684\u8bdd\uff0c\u53ef\u4ee5\u5148npm install git\n\n3.\u89e3\u538b\t\n  tar -zxvf nginx-1.19.6.tar.gz\n\n4.\u8fdb\u5165nginx\u76ee\u5f55\n  cd nginx-1.19.6\n\n5.\u7f16\u8bd1\u914d\u7f6e\n  .\/configure --add-module=\/tmp\/ngnix_install\/nginx-http-flv-module --with-http_mp4_module --with-http_flv_module\n\n6.\u5b89\u88c5\n  make\n  make install<\/pre>\n\n\n\n<p>\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u63d0\u793a\u9519\u8bef\u3002\u6bd4\u5982\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">.\/configure: error: the HTTP rewrite module requires the PCRE library.<\/pre>\n\n\n\n<p>\u89e3\u51b3\u529e\u6cd5\uff1ahttps:\/\/www.cnblogs.com\/moonhmily\/p\/11456720.html<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#\u5b89\u88c5 pcre-devel \u4e0e openssl-devel\n\nyum -y install pcre-devel openssl openssl-devel\n<\/pre>\n\n\n\n<p>nginx\u4f1a\u5b89\u88c5\u5230&nbsp;\/usr\/local\/nginx&nbsp;\u76ee\u5f55\u4e0b\u3002\u52a0\u5165\u5168\u5c40\u53d8\u91cf\uff0c\u4fee\u6539&#8221;\/etc\/profile&#8221;\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">export PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/local\/nginx\/sbin<\/pre>\n\n\n\n<p>\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u4f7f\u5168\u5c40\u53d8\u91cf\u751f\u6548\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">source \/etc\/profile<\/pre>\n\n\n\n<p>\u4fee\u6539nginx\u914d\u7f6e\u6587\u4ef6\/usr\/local\/nginx\/conf\/nginx.conf\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">daemon off;\n\nerror_log \/tmp\/nginx\/logs\/error.log debug;\n\nevents {\n    worker_connections 1024;\n}\n\nrtmp {\n\n    out_queue   4096;\n    out_cork    8;\n    max_streams 64;\n\n    server {\n        listen 1935;\n\n        application rtmplive {\n            live on;\n            record all;\n            # \u975e\u5e38\u91cd\u8981\uff0c \u8bbe\u5b9a\u8ba9ngnix\u65ad\u5f00\u963b\u585e\u4e2d\u7684\u8fde\u63a5\uff0c \u624d\u80fd\u89e6\u53d1exec_record_done\n            # \u4ee5\u53ca\u5ba2\u6237\u7aef\u7684LFLiveKit reconnectCount\u81ea\u52a8\u91cd\u65b0\u8fde\u63a5\u624d\u4f1a\u597d\u7528\n            drop_idle_publisher 5s;\n            record_path \/tmp\/video;\n            record_max_size 10485760K;\n            record_unique off;\n            record_append on;\n            gop_cache on;\n            allow play all;\n            meta off;\n            # record\u5b8c\u6210\u65f6\uff0c\u5229\u7528yamdi\u7ed9flv\u89c6\u9891\u52a0\u5173\u952e\u5e27\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u62d6\u62fd\u64ad\u653eflv\u4e86\uff0cyamdi\u9700\u8981\u9884\u5148\u5b89\u88c5\u3002\n            exec_record_done bash -c \"yamdi -i \/tmp\/video\/${name}.flv -o \/tmp\/video\/convert\/${name}.flv\";\n            # record\u5b8c\u6210\u65f6\uff0c\u5229\u7528ffmpeg\u628aflv\u8f6c\u6210MP4\u3002\n            exec_record_done bash -c \"ffmpeg -i \/tmp\/video\/${name}.flv \/tmp\/video\/${name}.mp4\";\n        }\n\n    }\n}\n\nhttp {\n    include mime.types;\n    default_type application\/octet-stream;\n    sendfile on;\n    keepalive_timeout 65;\n    gzip on;\n    access_log \/tmp\/nginx\/logs\/access.log;\n\n    server {\n        listen 8080;\n\n        location \/live {\n            flv_live on; #open flv live streaming (subscribe)\n            chunked_transfer_encoding  off; #open 'Transfer-Encoding: chunked' response\n            add_header 'Access-Control-Allow-Origin' '*'; #add additional HTTP header\n            add_header 'Access-Control-Allow-Credentials' 'true'; #add additional HTTP header\n        }\n\n        location ~ \\.flv$ {\n           add_header 'Access-Control-Allow-Origin' '*'; #\u6dfb\u52a0\u989d\u5916\u7684HTTP\u5934\n           add_header 'Access-Control-Allow-Credentials' 'true'; #\u6dfb\u52a0\u989d\u5916\u7684HTTP\u5934\n           flv;\n           root \/tmp\/video\/;\n        }\n    }\n}<\/pre>\n\n\n\n<p>\u542f\u52a8nginx\u670d\u52a1\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u505c\u6b62\u670d\u52a1\nnginx -s stop\n# \u542f\u52a8\u670d\u52a1\nnginx<\/pre>\n\n\n\n<p>\u9644\uff1aWeb Html \u4ee3\u7801<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html>\n&lt;html>\n\n&lt;head>\n    &lt;meta content=\"text\/html; charset=utf-8\" http-equiv=\"Content-Type\">\n    &lt;meta http-equiv=\"Access-Control-Allow-Origin\" content=\"*\">\n    &lt;title>flv.js demo&lt;\/title>\n\n    &lt;style>\n        .mainContainer {\n            display: block;\n            width: 1024px;\n            margin-left: auto;\n            margin-right: auto;\n        }\n\n        .urlInput {\n            display: block;\n            width: 100%;\n            margin-left: auto;\n            margin-right: auto;\n            margin-top: 8px;\n            margin-bottom: 8px;\n        }\n\n        .centeredVideo {\n            display: block;\n            width: 100%;\n            height: 576px;\n            margin-left: auto;\n            margin-right: auto;\n            margin-bottom: auto;\n        }\n\n        .controls {\n            display: block;\n            width: 100%;\n            text-align: left;\n            margin-left: auto;\n            margin-right: auto;\n            margin-top: 8px;\n            margin-bottom: 10px;\n        }\n\n        .logcatBox {\n            border-color: #CCCCCC;\n            font-size: 11px;\n            font-family: Menlo, Consolas, monospace;\n            display: block;\n            width: 100%;\n            text-align: left;\n            margin-left: auto;\n            margin-right: auto;\n        }\n    &lt;\/style>\n\n  &lt;script>(window.BOOMR_mq=window.BOOMR_mq||[]).push([\"addVar\",{\"rua.upush\":\"false\",\"rua.cpush\":\"false\",\"rua.upre\":\"false\",\"rua.cpre\":\"false\",\"rua.uprl\":\"false\",\"rua.cprl\":\"false\",\"rua.cprf\":\"false\",\"rua.trans\":\"SJ-5e36293a-d34b-446f-a17d-140c847d00ce\",\"rua.cook\":\"true\",\"rua.ims\":\"false\",\"rua.ufprl\":\"false\",\"rua.cfprl\":\"true\"}]);&lt;\/script>\n                          &lt;script>!function(e){var n=\"https:\/\/s.go-mpulse.net\/boomerang\/\";if(\"False\"==\"True\")e.BOOMR_config=e.BOOMR_config||{},e.BOOMR_config.PageParams=e.BOOMR_config.PageParams||{},e.BOOMR_config.PageParams.pci=!0,n=\"https:\/\/s2.go-mpulse.net\/boomerang\/\";if(window.BOOMR_API_key=\"8WMGS-R456H-64GN8-4FVQL-CTDMX\",function(){function e(){if(!o){var e=document.createElement(\"script\");e.id=\"boomr-scr-as\",e.src=window.BOOMR.url,e.async=!0,i.parentNode.appendChild(e),o=!0}}function t(e){o=!0;var n,t,a,r,d=document,O=window;if(window.BOOMR.snippetMethod=e?\"if\":\"i\",t=function(e,n){var t=d.createElement(\"script\");t.id=n||\"boomr-if-as\",t.src=window.BOOMR.url,BOOMR_lstart=(new Date).getTime(),e=e||d.body,e.appendChild(t)},!window.addEventListener&amp;&amp;window.attachEvent&amp;&amp;navigator.userAgent.match(\/MSIE [67]\\.\/))return window.BOOMR.snippetMethod=\"s\",void t(i.parentNode,\"boomr-async\");a=document.createElement(\"IFRAME\"),a.src=\"about:blank\",a.title=\"\",a.role=\"presentation\",a.loading=\"eager\",r=(a.frameElement||a).style,r.width=0,r.height=0,r.border=0,r.display=\"none\",i.parentNode.appendChild(a);try{O=a.contentWindow,d=O.document.open()}catch(c){n=document.domain,a.src=\"javascript:var d=document.open();d.domain='\"+n+\"';void(0);\",O=a.contentWindow,d=O.document.open()}if(n)d._boomrl=function(){this.domain=n,t()},d.write(\"&lt;bo\"+\"dy onload='document._boomrl();'>\");else if(O._boomrl=function(){t()},O.addEventListener)O.addEventListener(\"load\",O._boomrl,!1);else if(O.attachEvent)O.attachEvent(\"onload\",O._boomrl);d.close()}function a(e){window.BOOMR_onload=e&amp;&amp;e.timeStamp||(new Date).getTime()}if(!window.BOOMR||!window.BOOMR.version&amp;&amp;!window.BOOMR.snippetExecuted){window.BOOMR=window.BOOMR||{},window.BOOMR.snippetStart=(new Date).getTime(),window.BOOMR.snippetExecuted=!0,window.BOOMR.snippetVersion=12,window.BOOMR.url=n+\"8WMGS-R456H-64GN8-4FVQL-CTDMX\";var i=document.currentScript||document.getElementsByTagName(\"script\")[0],o=!1,r=document.createElement(\"link\");if(r.relList&amp;&amp;\"function\"==typeof r.relList.supports&amp;&amp;r.relList.supports(\"preload\")&amp;&amp;\"as\"in r)window.BOOMR.snippetMethod=\"p\",r.href=window.BOOMR.url,r.rel=\"preload\",r.as=\"script\",r.addEventListener(\"load\",e),r.addEventListener(\"error\",function(){t(!0)}),setTimeout(function(){if(!o)t(!0)},3e3),BOOMR_lstart=(new Date).getTime(),i.parentNode.appendChild(r);else t(!1);if(window.addEventListener)window.addEventListener(\"load\",a,!1);else if(window.attachEvent)window.attachEvent(\"onload\",a)}}(),\"\".length>0)if(e&amp;&amp;\"performance\"in e&amp;&amp;e.performance&amp;&amp;\"function\"==typeof e.performance.setResourceTimingBufferSize)e.performance.setResourceTimingBufferSize();!function(){if(BOOMR=e.BOOMR||{},BOOMR.plugins=BOOMR.plugins||{},!BOOMR.plugins.AK){var n=\"true\"==\"true\"?1:0,t=\"cookiepresent\",a=\"mxt2zrqxyzslgyagkhdq-f-305d4396d-clientnsv4-s.akamaihd.net\",i={\"ak.v\":\"30\",\"ak.cp\":\"757416\",\"ak.ai\":parseInt(\"492561\",10),\"ak.ol\":\"0\",\"ak.cr\":139,\"ak.ipv\":4,\"ak.proto\":\"h2\",\"ak.rid\":\"d007a7\",\"ak.r\":20734,\"ak.a2\":n,\"ak.m\":\"\",\"ak.n\":\"essl\",\"ak.bpcip\":\"101.231.172.0\",\"ak.cport\":39331,\"ak.gh\":\"23.32.20.70\",\"ak.quicv\":\"\",\"ak.tlsv\":\"tls1.3\",\"ak.0rtt\":\"\",\"ak.csrc\":\"-\",\"ak.acc\":\"\",\"ak.t\":\"1611026887\",\"ak.ak\":\"hOBiQwZUYzCg5VSAfCLimQ==+n1cMpzO\/R\/fScTtk0hQtDJwRIm9ZkgByEMOknM4Rz1Q5T6RXrm9\/tQ6M6TOP1vRjMbWZzBQhouDArhC\/knPX6b9UmEZjzuwoj+nEgDPDP3WY\/xMAugQIPPMhkXjSikS1w+KpeoMX8E6Dzko5axPQF8clQL27wu+rvBhw3zW+lwF2bm1rz2C5B9dCrJiJAHx4xXnxoKH3JJqClNi1jt5vpMjCnLm9lW19bEEmAicxZBAhUpdEGyAINM9iAgeIhrpMNwUaFgEjgKtFSPsEoiFl8WvCpMCWx4MlIdciSWZyFx1\/1pVseY+VBrmC92KcGUeSNJcnE0zPpo6uGzZK\/RPRC7XOM+YZueR0zowq+SqDRsTPWDwzQw7+24u7LTo7hfcdtwtW9qUQxGR2YIY\/P8QDhT2fscX5qJ6kRPfi4EShGo=\",\"ak.pv\":\"150\",\"ak.dpoabenc\":\"\"};if(\"\"!==t)i[\"ak.ruds\"]=t;var o={i:!1,av:function(n){var t=\"http.initiator\";if(n&amp;&amp;(!n[t]||\"spa_hard\"===n[t]))i[\"ak.feo\"]=void 0!==e.aFeoApplied?1:0,BOOMR.addVar(i)},rv:function(){var e=[\"ak.bpcip\",\"ak.cport\",\"ak.cr\",\"ak.csrc\",\"ak.gh\",\"ak.ipv\",\"ak.m\",\"ak.n\",\"ak.ol\",\"ak.proto\",\"ak.quicv\",\"ak.tlsv\",\"ak.0rtt\",\"ak.r\",\"ak.acc\",\"ak.t\"];BOOMR.removeVar(e)}};BOOMR.plugins.AK={akVars:i,akDNSPreFetchDomain:a,init:function(){if(!o.i){var e=BOOMR.subscribe;e(\"before_beacon\",o.av,null,null),e(\"onbeacon\",o.rv,null,null),o.i=!0}return this},is_complete:function(){return!0}}}}()}(window);&lt;\/script>&lt;\/head>\n\n&lt;body>\n    \n    &lt;div class=\"mainContainer\">\n        &lt;input type=\"button\" value='1000-1030' onclick=\"playMedia(1000,1060)\">\u7b2c1000\u79d2\u5f00\u59cb-1060\u79d2\u65f6\u6682\u505c \n        &lt;video name=\"videoElement\" class=\"centeredVideo\" id=\"videoElement\" controls width=\"1024\" height=\"576\" autoplay>\n            Your browser is too old which doesn't support HTML5 video.\n        &lt;\/video>\n\n    &lt;\/div>\n\n    &lt;script>\n\/\/ akam-sw.js install script version 1.3.3\n\"serviceWorker\"in navigator&amp;&amp;\"find\"in[]&amp;&amp;function(){var e=new Promise(function(e){\"complete\"===document.readyState||!1?e():(window.addEventListener(\"load\",function(){e()}),setTimeout(function(){\"complete\"!==document.readyState&amp;&amp;e()},1e4))}),n=window.akamServiceWorkerInvoked,r=\"1.3.3\";if(n)aka3pmLog(\"akam-setup already invoked\");else{window.akamServiceWorkerInvoked=!0,window.aka3pmLog=function(){window.akamServiceWorkerDebug&amp;&amp;console.log.apply(console,arguments)};function o(e){(window.BOOMR_mq=window.BOOMR_mq||[]).push([\"addVar\",{\"sm.sw.s\":e,\"sm.sw.v\":r}])}var i=\"\/akam-sw.js\",a=new Map;navigator.serviceWorker.addEventListener(\"message\",function(e){var n,r,o=e.data;if(o.isAka3pm)if(o.command){var i=(n=o.command,(r=a.get(n))&amp;&amp;r.length>0?r.shift():null);i&amp;&amp;i(e.data.response)}else if(o.commandToClient)switch(o.commandToClient){case\"enableDebug\":window.akamServiceWorkerDebug||(window.akamServiceWorkerDebug=!0,aka3pmLog(\"Setup script debug enabled via service worker message\"),p());break;case\"boomerangMQ\":o.payload&amp;&amp;(window.BOOMR_mq=window.BOOMR_mq||[]).push(o.payload)}aka3pmLog(\"akam-sw message: \"+JSON.stringify(e.data))});var t=function(e){return new Promise(function(n){var r,o;r=e.command,o=n,a.has(r)||a.set(r,[]),a.get(r).push(o),navigator.serviceWorker.controller&amp;&amp;(e.isAka3pm=!0,navigator.serviceWorker.controller.postMessage(e))})},c=function(e){return t({command:\"navTiming\",navTiming:e})},s=null,m={},d=function(){var e=i;return s&amp;&amp;(e+=\"?othersw=\"+encodeURIComponent(s)),function(e,n){return new Promise(function(r,i){aka3pmLog(\"Registering service worker with URL: \"+e),navigator.serviceWorker.register(e,n).then(function(e){aka3pmLog(\"ServiceWorker registration successful with scope: \",e.scope),r(e),o(1)}).catch(function(e){aka3pmLog(\"ServiceWorker registration failed: \",e),o(0),i(e)})})}(e,m)},g=ServiceWorkerContainer.prototype.register;if(ServiceWorkerContainer.prototype.register=function(n,r){return n.includes(i)?g.call(this,n,r):(aka3pmLog(\"Overriding registration of service worker for: \"+n),s=new URL(n,window.location.href),m=r,navigator.serviceWorker.controller?new Promise(function(n,r){var o=navigator.serviceWorker.controller.scriptURL;if(o.includes(i)){var a=encodeURIComponent(s);o.includes(a)?(aka3pmLog(\"Cancelling registration as we already integrate other SW: \"+s),navigator.serviceWorker.getRegistration().then(function(e){n(e)})):e.then(function(){aka3pmLog(\"Unregistering existing 3pm service worker\"),navigator.serviceWorker.getRegistration().then(function(e){e.unregister().then(function(){return d()}).then(function(e){n(e)}).catch(function(e){r(e)})})})}else aka3pmLog(\"Cancelling registration as we already have akam-sw.js installed\"),navigator.serviceWorker.getRegistration().then(function(e){n(e)})}):g.call(this,n,r))},navigator.serviceWorker.controller){var u=navigator.serviceWorker.controller.scriptURL;u.includes(\"\/akam-sw.js\")||u.includes(\"\/akam-sw-preprod.js\")||u.includes(\"\/threepm-sw.js\")||(aka3pmLog(\"Detected existing service worker. Removing and re-adding inside akam-sw.js\"),s=new URL(u,window.location.href),e.then(function(){navigator.serviceWorker.getRegistration().then(function(e){m={scope:e.scope},e.unregister(),d()})}))}else e.then(function(){window.akamServiceWorkerPreprod&amp;&amp;(i=\"\/akam-sw-preprod.js\"),d()});if(window.performance){var w=window.performance.timing,l=w.responseEnd-w.responseStart;c(l)}e.then(function(){t({command:\"pageLoad\"})});var k=!1;function p(){window.akamServiceWorkerDebug&amp;&amp;!k&amp;&amp;(k=!0,aka3pmLog(\"Initializing debug functions at window scope\"),window.aka3pmInjectSwPolicy=function(e){return t({command:\"updatePolicy\",policy:e})},window.aka3pmDisableInjectedPolicy=function(){return t({command:\"disableInjectedPolicy\"})},window.aka3pmDeleteInjectedPolicy=function(){return t({command:\"deleteInjectedPolicy\"})},window.aka3pmGetStateAsync=function(){return t({command:\"getState\"})},window.aka3pmDumpState=function(){aka3pmGetStateAsync().then(function(e){aka3pmLog(JSON.stringify(e,null,\"\\t\"))})},window.aka3pmInjectTiming=function(e){return c(e)},window.aka3pmUpdatePolicyFromNetwork=function(){return t({command:\"pullPolicyFromNetwork\"})})}p()}}();&lt;\/script>\n&lt;script src=\"https:\/\/stafo.s3.au-syd.cloud-object-storage.appdomain.cloud\/flv.js?v=2\">&lt;\/script>\n    \n    &lt;script>\n         if (flvjs.isSupported()) {\n            startVideo()\n        }\n\n        function startVideo(){\n            var videoElement = document.getElementById('videoElement');\n            var flvPlayer = flvjs.createPlayer({\n                type: 'flv',\n                isLive: true,\n                hasAudio: true,\n                hasVideo: true,\n                enableStashBuffer: true,\n                \/\/url: 'http:\/\/123.57.164.21:8080\/live?port=1935&amp;app=rtmplive&amp;stream=cs'\n                url: 'http:\/\/123.57.164.21:8080\/test.flv'\n            });\n            flvPlayer.attachMediaElement(videoElement);\n            flvPlayer.load();\n            flvPlayer.play();\n        }\n\n        \/\/ videoElement.addEventListener('click', function(){\n        \/\/     alert( '\u662f\u5426\u652f\u6301\u70b9\u64ad\u89c6\u9891\uff1a' + flvjs.getFeatureList().mseFlvPlayback + ' \u662f\u5426\u652f\u6301httpflv\u76f4\u64ad\u6d41\uff1a' + flvjs.getFeatureList().mseLiveFlvPlayback )\n        \/\/ })\n\n        function destoryVideo(){\n            flvPlayer.pause();\n            flvPlayer.unload();\n            flvPlayer.detachMediaElement();\n            flvPlayer.destroy();\n            flvPlayer = null;\n        }\n\n        function reloadVideo(){\n            destoryVideo()\n            startVideo()\n        }\n    &lt;\/script>\n\n    &lt;script> \n \n    var myVid=document.getElementById(\"videoElement\"); \n    myVid.addEventListener(\"timeupdate\",timeupdate); \n \n    var _endTime; \n \n    \/\/\u89c6\u9891\u64ad\u653e \n    function playMedia(startTime,endTime){ \n        \/\/\u8bbe\u7f6e\u7ed3\u675f\u65f6\u95f4 \n        _endTime = endTime; \n        myVid.currentTime=startTime; \n          myVid.play(); \n    } \n     \n    function timeupdate(){ \n        \/\/\u56e0\u4e3a\u5f53\u524d\u7684\u683c\u5f0f\u662f\u5e26\u6beb\u79d2\u7684float\u7c7b\u578b\u7684\u5982\uff1a12.231233\uff0c\u6240\u4ee5\u628a\u4ed6\u8f6c\u6210String\u4e86\u4fbf\u4e8e\u540e\u9762\u5206\u5272\u53d6\u79d2 \n        var time = myVid.currentTime+\"\"; \n        document.getElementById(\"showTime\").value=time; \n        var ts = time.substring(0,time.indexOf(\".\")); \n        if(ts==_endTime){ \n            myVid.pause(); \n        } \n         \n    } \n \n&lt;\/script> \n    \n&lt;script type=\"text\/javascript\" >var _cf = _cf || []; _cf.push(['_setFsp', true]);  _cf.push(['_setBm', true]);  _cf.push(['_setAu', '\/content\/5c0ecc8c60rn208f1cd259d7f5af68bf']); &lt;\/script>&lt;script type=\"text\/javascript\"  src=\"\/content\/5c0ecc8c60rn208f1cd259d7f5af68bf\">&lt;\/script>&lt;\/body>\n\n&lt;\/html><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">4 \u914d\u7f6engnix Https \u8bbf\u95ee<\/h4>\n\n\n\n<p>\u8f6c\u5230ngnix\u89e3\u538b\u7f29\u540e\u7684\u5b89\u88c5\u76ee\u5f55\uff0c\u6dfb\u52a0<strong>&#8211;with-http_ssl_module<\/strong> \u6a21\u5757\uff0c\u91cd\u65b0\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">.\/configure --add-module=\/tmp\/ngnix_install\/nginx-http-flv-module --with-http_mp4_module --with-http_flv_module --with-http_ssl_module\n\nmake install<\/pre>\n\n\n\n<p>\u628a\u7533\u8bf7\u597d\u7684SSL\u8bc1\u4e66\u548c\u5bf9\u5e94\u7684\u79c1\u94a5\u5728\u670d\u52a1\u5668\u4e0a\u653e\u597d\u3002\uff08\u7533\u8bf7SSL\u8bc1\u4e66\u90e8\u5206\u7565\uff09<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2021\/01\/image-62-1024x384.png\" alt=\"\" class=\"wp-image-1578\" width=\"518\" height=\"194\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-62-1024x384.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-62-300x113.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-62-768x288.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-62-830x311.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-62-230x86.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-62-350x131.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-62-480x180.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-62.png 1088w\" sizes=\"(max-width: 518px) 100vw, 518px\" \/><\/figure><\/div>\n\n\n\n<p>\u4fee\u6539ngnix conf\u6587\u4ef6\uff0c\u6dfb\u52a0SSL\u90e8\u5206\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">daemon off;\n\nerror_log \/tmp\/nginx\/logs\/error.log debug;\n\nevents {\n    worker_connections 1024;\n}\n\nrtmp {\n\n    out_queue   4096;\n    out_cork    8;\n    max_streams 64;\n\n    server {\n        listen 1935;\n\n        application rtmplive {\n            live on;\n            record all;\n            record_path \/tmp\/video;\n            record_max_size 10485760K;\n            record_unique off;\n            record_append on;\n            gop_cache on;\n            allow play all;\n            meta off;\n            #exec_record_done bash -c \"yamdi -i \/tmp\/video\/${name}.flv -o \/tmp\/video\/convert\/${name}.flv\";\n            exec_record_done bash -c \"ffmpeg -i \/tmp\/video\/${name}.flv -vcodec copy -acodec copy \/tmp\/video\/${name}.mp4\";\n        }\n\n        application rtmphls {\n            live on;\n            hls on;\n            record all;\n            record_append on;\n            record_max_size 10485760K;\n            record_path \/tmp\/hls;\n            hls_fragment_naming system;\n            hls_fragment 5s;\n            hls_path \/tmp\/hls;\n            hls_cleanup off;\n        }\n\n    }\n}\n\nhttp {\n    include mime.types;\n    default_type application\/octet-stream;\n    sendfile on;\n    keepalive_timeout 65;\n    gzip on;\n    access_log \/tmp\/nginx\/logs\/access.log;\n\n    server {\n        listen 8080 ssl;\n        server_name  92it.top;\n\n        ssl_certificate \/tmp\/ssl\/1_92it.top_bundle.crt;\n        ssl_certificate_key \/tmp\/ssl\/2_92it.top.key;\n        ssl_session_timeout 5m;\n        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #\u6309\u7167\u8fd9\u4e2a\u534f\u8bae\u914d\u7f6e\n        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#\u6309\u7167\u8fd9\u4e2a\u5957\u4ef6\u914d\u7f6e\n        ssl_prefer_server_ciphers on;\n\n        location \/live {\n            flv_live on; #open flv live streaming (subscribe)\n            chunked_transfer_encoding  off; #open 'Transfer-Encoding: chunked' response\n            add_header 'Access-Control-Allow-Origin' '*'; #add additional HTTP header\n            add_header 'Access-Control-Allow-Credentials' 'true'; #add additional HTTP header\n        }\n\n        location \/hls {\n            types {\n                application\/vnd.apple.mpegurl m3u8;\n                video\/mp2t ts;\n            }\n            root \/tmp;\n            add_header Cache-Control no-cache;\n            add_header 'Access-Control-Allow-Origin' '*'; #add additional HTTP header\n            add_header 'Access-Control-Allow-Credentials' 'true'; #add additional HTTP header\n        }\n\n        location ~ \\.flv$ {\n           add_header 'Access-Control-Allow-Origin' '*'; \n           add_header 'Access-Control-Allow-Credentials' 'true';\n           flv;\n           root \/tmp\/video\/convert\/;\n        }\n\n        location ~ \\.mp4$ {\n           add_header 'Access-Control-Allow-Origin' '*'; \n           add_header 'Access-Control-Allow-Credentials' 'true';\n           mp4;\n           root \/tmp\/video\/convert\/;\n        }\n    }\n}<\/pre>\n\n\n\n<p>\u914d\u7f6e\u597d\u4ee5\u540e\uff0c\u542f\u52a8ngnix\u670d\u52a1\u3002\u53ef\u4ee5\u770b\u5230Https\u5df2\u7ecf\u751f\u6548\uff0c\u63d0\u793a\u53d7\u4fdd\u62a4\u7684\u8fde\u63a5\u4e86\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">nginx<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2021\/01\/image-63.png\" alt=\"\" class=\"wp-image-1579\" width=\"512\" height=\"275\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-63.png 1000w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-63-300x161.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-63-768x413.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-63-830x447.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-63-230x124.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-63-350x188.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-63-480x258.png 480w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2021\/01\/image-64.png\" alt=\"\" class=\"wp-image-1580\" width=\"514\" height=\"229\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-64.png 952w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-64-300x134.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-64-768x344.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-64-830x371.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-64-230x103.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-64-350x157.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2021\/01\/image-64-480x215.png 480w\" sizes=\"(max-width: 514px) 100vw, 514px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u4e2a\u67b6\u6784\u5728IOS\u7aef\u5229\u7528\uff0cLFliveKit\u63a8\u6d41\u5230nginx\u670d\u52a1\u5668\uff0c\u751f\u6210flv\u6587\u4ef6\u3002\u76f4\u64ad\u7ed3\u675f\u7136\u540e\u5229\u7528yamid\u5bf9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/1498"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1498"}],"version-history":[{"count":15,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/1498\/revisions"}],"predecessor-version":[{"id":1955,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/1498\/revisions\/1955"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}