{"id":955,"date":"2025-08-09T11:12:58","date_gmt":"2025-08-09T03:12:58","guid":{"rendered":"https:\/\/www.vcidc.net\/blog\/?p=955"},"modified":"2025-08-09T11:12:58","modified_gmt":"2025-08-09T03:12:58","slug":"%e5%be%b7%e8%ae%af%e7%94%b5%e8%ae%af%e6%8e%a8%e8%8d%90%ef%bc%9a%e6%89%93%e9%80%a0%e5%bc%ba%e5%a4%a7%e7%9a%84%e5%bd%95%e6%92%ad%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.vcidc.net\/blog\/955.html","title":{"rendered":"\u5fb7\u8baf\u7535\u8baf\u63a8\u8350\uff1a\u6253\u9020\u5f3a\u5927\u7684\u5f55\u64ad\u670d\u52a1\u5668"},"content":{"rendered":"<p><p>\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5982\u4f55\u8bbe\u7f6e\u548c\u7ef4\u62a4\u4e00\u4e2a\u5f55\u64ad\u670d\u52a1\u5668\uff0c\u4ee5\u6ee1\u8db3\u5728\u7ebf\u6559\u80b2\u3001\u8fdc\u7a0b\u57f9\u8bad\u6216\u89c6\u9891\u76f4\u64ad\u7684\u9700\u6c42\u3002\u6211\u4eec\u5c06\u4ece\u51c6\u5907\u5de5\u4f5c\u5f00\u59cb\uff0c\u9010\u6b65\u8bb2\u89e3\u5b89\u88c5\u3001\u914d\u7f6e\u548c\u5e38\u89c1\u95ee\u9898\u89e3\u51b3\u3002<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.vcidc.net\/blog\/wp-content\/uploads\/2025\/07\/p4qz0.jpg\" alt=\"\u5fb7\u8baf\u7535\u8baf\u63a8\u8350\uff1a\u6253\u9020\u5f3a\u5927\u7684\u5f55\u64ad\u670d\u52a1\u5668\" title=\"\u5fb7\u8baf\u7535\u8baf\u63a8\u8350\uff1a\u6253\u9020\u5f3a\u5927\u7684\u5f55\u64ad\u670d\u52a1\u5668\"><\/p>\n<\/p>\n<p><h2>\u64cd\u4f5c\u524d\u7684\u51c6\u5907<\/h2>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u7684\u670d\u52a1\u5668\u6ee1\u8db3\u4ee5\u4e0b\u57fa\u672c\u8981\u6c42\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u8db3\u591f\u7684CPU\u548c\u5185\u5b58\u8d44\u6e90<\/li>\n<li>\u7a33\u5b9a\u7684\u7f51\u7edc\u8fde\u63a5<\/li>\n<li>\u64cd\u4f5c\u7cfb\u7edf\uff1a\u63a8\u8350\u4f7f\u7528Linux\u53d1\u884c\u7248\uff0c\u5982Ubuntu\u6216CentOS<\/li>\n<\/ul>\n<p><h2>1. \u5b89\u88c5\u5f55\u64ad\u670d\u52a1\u5668\u8f6f\u4ef6<\/h2>\n<\/p>\n<p><h3>1.1 \u5b89\u88c5FFmpeg<\/h3>\n<\/p>\n<p><p>FFmpeg\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u591a\u5a92\u4f53\u5904\u7406\u5de5\u5177\uff0c\u7528\u4e8e\u5f55\u5236\u3001\u8f6c\u6362\u548c\u6d41\u5f0f\u4f20\u8f93\u97f3\u9891\u548c\u89c6\u9891\u3002<\/p>\n<\/p>\n<p><pre><code>sudo apt-get update<\/p>\r\n<p>sudo apt-get install ffmpeg<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>1.2 \u5b89\u88c5Nginx<\/h3>\n<\/p>\n<p><p>Nginx\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684HTTP\u548c\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u9002\u7528\u4e8e\u6d41\u5a92\u4f53\u670d\u52a1\u3002<\/p>\n<\/p>\n<p><pre><code>sudo apt-get install nginx<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>1.3 \u5b89\u88c5RTMP\u6a21\u5757<\/h3>\n<\/p>\n<p><p>RTMP\u662fAdobe Real Time Messaging Protocol\u7684\u7f29\u5199\uff0c\u7528\u4e8e\u76f4\u64ad\u6d41\u4f20\u8f93\u3002<\/p>\n<\/p>\n<p><pre><code>sudo apt-get install libnginx-mod-rtmp<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>2. \u914d\u7f6eNginx\u670d\u52a1\u5668<\/h2>\n<\/p>\n<p><h3>2.1 \u7f16\u8f91Nginx\u914d\u7f6e\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u7f16\u8f91Nginx\u7684RTMP\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code>sudo nano \/etc\/nginx\/sites-available\/rtmp<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff1a<\/p>\n<\/p>\n<p><pre><code>rtmp {<\/p>\r\n<p>    server {<\/p>\r\n<p>        listen 1935;<\/p>\r\n<p>        chunk_size 4096;<\/p>\r\n\r\n<p>        application live {<\/p>\r\n<p>            live on;<\/p>\r\n<p>            record off;<\/p>\r\n<p>        }<\/p>\r\n<p>    }<\/p>\r\n<p>}<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2.2 \u91cd\u542fNginx\u670d\u52a1<\/h3>\n<\/p>\n<p><p>\u4f7f\u914d\u7f6e\u751f\u6548\u5e76\u91cd\u542fNginx\u670d\u52a1\u3002<\/p>\n<\/p>\n<p><pre><code>sudo systemctl restart nginx<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>3. \u4f7f\u7528FFmpeg\u8fdb\u884c\u5f55\u5236<\/h2>\n<\/p>\n<p><h3>3.1 \u57fa\u672c\u5f55\u5236\u547d\u4ee4<\/h3>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u57fa\u672c\u7684FFmpeg\u5f55\u5236\u547d\u4ee4\u793a\u4f8b\uff0c\u7528\u4e8e\u4eceRTMP\u6e90\u5f55\u5236\u89c6\u9891\u3002<\/p>\n<\/p>\n<p><pre><code>ffmpeg -i rtmp:\/\/yourserver\/live\/streamname -c copy output.mp4<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d\uff0c<strong>yourserver<\/strong> \u662f\u60a8\u7684\u670d\u52a1\u5668\u5730\u5740\uff0c<strong>streamname<\/strong> \u662fRTMP\u6d41\u7684\u540d\u79f0\uff0c<strong>output.mp4<\/strong> \u662f\u5f55\u5236\u6587\u4ef6\u7684\u8f93\u51fa\u8def\u5f84\u548c\u540d\u79f0\u3002<\/p>\n<\/p>\n<p><h2>4. \u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848<\/h2>\n<\/p>\n<p><h3>4.1 RTMP\u8fde\u63a5\u5931\u8d25<\/h3>\n<\/p>\n<p><p>\u68c0\u67e5Nginx\u7684RTMP\u914d\u7f6e\uff0c\u786e\u4fdd\u76d1\u542c\u7aef\u53e3\u6b63\u786e\uff0c\u4e14\u670d\u52a1\u5668\u7f51\u7edc\u672a\u53d7\u9650\u3002<\/p>\n<\/p>\n<p><h3>4.2 \u5f55\u5236\u6587\u4ef6\u65e0\u6cd5\u64ad\u653e<\/h3>\n<\/p>\n<p><p>\u786e\u4fdd\u4f7f\u7528\u7684\u7f16\u7801\u548c\u89e3\u7801\u5668\u517c\u5bb9\uff0c\u5e76\u4e14\u8f93\u51fa\u6587\u4ef6\u7684\u683c\u5f0f\u6b63\u786e\u3002<\/p>\n<\/p>\n<p><h2>5. \u5b9e\u7528\u6280\u5de7<\/h2>\n<\/p>\n<ul>\n<li>\u5b9a\u671f\u5907\u4efd\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u548c\u6570\u636e\u3002<\/li>\n<li>\u76d1\u63a7\u670d\u52a1\u5668\u6027\u80fd\uff0c\u786e\u4fdd\u6709\u8db3\u591f\u7684\u8d44\u6e90\u5904\u7406\u9ad8\u5e76\u53d1\u8bf7\u6c42\u3002<\/li>\n<li>\u4f7f\u7528\u8d1f\u8f7d\u5747\u8861\u5668\u5206\u6563\u6d41\u91cf\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u5e94\u8be5\u5df2\u7ecf\u6210\u529f\u642d\u5efa\u4e86\u4e00\u4e2a\u57fa\u7840\u7684\u5f55\u64ad\u670d\u52a1\u5668\u3002\u6839\u636e\u5b9e\u9645\u9700\u6c42\uff0c\u60a8\u8fd8\u53ef\u4ee5\u8fdb\u4e00\u6b65\u6269\u5c55\u529f\u80fd\uff0c\u5982\u6dfb\u52a0\u76f4\u64ad\u63a8\u6d41\u3001\u89c6\u9891\u8f6c\u7801\u7b49\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5982\u4f55\u8bbe\u7f6e\u548c\u7ef4\u62a4\u4e00\u4e2a\u5f55\u64ad\u670d\u52a1\u5668\uff0c\u4ee5\u6ee1\u8db3\u5728\u7ebf\u6559\u80b2\u3001\u8fdc\u7a0b\u57f9\u8bad\u6216\u89c6\u9891\u76f4\u64ad\u7684\u9700\u6c42\u3002\u6211\u4eec\u5c06\u4ece\u51c6\u5907\u5de5\u4f5c\u5f00\u59cb\uff0c\u9010\u6b65\u8bb2\u89e3\u5b89\u88c5\u3001\u914d\u7f6e\u548c\u5e38\u89c1\u95ee\u9898\u89e3\u51b3\u3002 \u64cd\u4f5c\u524d\u7684\u51c6\u5907 \u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u7684\u670d\u52a1\u5668\u6ee1\u8db3\u4ee5\u4e0b\u57fa\u672c\u8981\u6c42\uff1a \u8db3\u591f\u7684CPU\u548c\u5185\u5b58\u8d44\u6e90 \u7a33\u5b9a\u7684\u7f51\u7edc\u8fde&#8230;<\/p>\n","protected":false},"author":1,"featured_media":956,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[379,77,378],"topic":[],"class_list":["post-955","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-foreign-server","tag-ffmpeg","tag-sudo","tag-378"],"_links":{"self":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/comments?post=955"}],"version-history":[{"count":1,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/955\/revisions"}],"predecessor-version":[{"id":958,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/955\/revisions\/958"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media\/956"}],"wp:attachment":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media?parent=955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/categories?post=955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/tags?post=955"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/topic?post=955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}