{"id":11650,"date":"2025-04-18T18:54:43","date_gmt":"2025-04-18T10:54:43","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/11650.html"},"modified":"2025-04-18T18:54:43","modified_gmt":"2025-04-18T10:54:43","slug":"%e4%bd%bf%e7%94%a8zlmediakit-%e5%bc%80%e6%ba%90%e9%a1%b9%e7%9b%ae%e6%90%ad%e5%bb%bartsp-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/11650.html","title":{"rendered":"\u4f7f\u7528ZLMediaKit \u5f00\u6e90\u9879\u76ee\u642d\u5efaRTSP \u670d\u52a1\u5668"},"content":{"rendered":"<h2>ZLMediaKit \u662f\u5565&#xff1f;<\/h2>\n<\/p>\n<p>ZLMediaKit\u662f\u56fd\u4eba\u5f00\u53d1\u7684\u5f00\u6e90C&#043;&#043;\u6d41\u5a92\u4f53\u670d\u52a1\u5668&#xff0c;\u540cSRS\u4e00\u6837\u662f\u4e3b\u6d41\u7684\u6d41\u5a92\u4f53\u670d\u52a1\u5668\u3002 ZLToolKit\u662f\u57fa\u4e8eC&#043;&#043;11\u7684\u9ad8\u6027\u80fd\u670d\u52a1\u5668\u6846\u67b6&#xff0c;\u548cZLMediaKit\u662f\u540c\u4e00\u4e2a\u4f5c\u8005&#xff0c;ZLMediaKit\u6b63\u662f\u4f7f\u7528\u8be5\u6846\u67b6\u5f00\u53d1\u7684\u3002<\/p>\n<\/p>\n<h2>\u5b98\u7f51<\/h2>\n<p>ZLMediaKit\u5f00\u6e90\u5730\u5740&#xff1a;https:\/\/github.com\/ZLMediaKit\/ZLMediaKit ZLToolKit\u5f00\u6e90\u5730\u5740&#xff1a;https:\/\/github.com\/ZLMediaKit\/ZLToolKit<\/p>\n<\/p>\n<p>\u56fd\u5185\u767b\u9646github\u975e\u5e38\u4e0d\u7a33\u5b9a&#xff0c;\u5982\u4e0b\u662fZLMediaKit\u5bf9\u5e94\u7684gitee \u7f51\u5740<\/p>\n<p>ZLMediaKit: \u5b9e\u73b0RTSP\/RTMP\/HLS\/HTTP\u534f\u8bae\u7684\u8f7b\u91cf\u7ea7\u6d41\u5a92\u4f53\u6846\u67b6&#xff0c;\u652f\u6301\u5927\u5e76\u53d1\u8fde\u63a5\u8bf7\u6c42 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<\/p>\n<\/p>\n<h2>ZLMediaKit\u6e90\u7801\u5206\u6790\u7684\u4e00\u7bc7\u6587\u7ae0<\/h2>\n<p>\u539f\u6587\u94fe\u63a5&#xff1a;https:\/\/blog.csdn.net\/weixin_40355471\/article\/details\/135422631<\/p>\n<\/p>\n<h2>1.\u5982\u4f55\u4f7f\u7528\u00a0ZLMediaKit \u642d\u5efaRTSP \u670d\u52a1\u5668<\/h2>\n<\/p>\n<h3><span style=\"color:#6a737d\">1.\u56fd\u5185\u2f64\u6237\u63a8\u8350\u4ece\u540c\u6b65\u955c\u50cf\u2f79\u7ad9<\/span><span style=\"color:#6a737d\">gitee<\/span><span style=\"color:#6a737d\">\u4e0b\u8f7d\u6e90\u7801<\/span><\/h3>\n<\/p>\n<p> <span style=\"color:#6f42c1\">git <\/span><br \/>\n <span style=\"color:#595959\">clone <\/span><br \/>\n <span style=\"color:#6f42c1\">&#8211;depth <\/span><br \/>\n <span style=\"color:#005cc5\">1 <\/span><br \/>\n <span style=\"color:#595959\">https:\/\/gitee.com\/xia-chu\/ZLMediaKit.git <\/span> <\/p>\n<p> <span style=\"color:#6f42c1\">cd <\/span><br \/>\n <span style=\"color:#595959\">ZLMediaKit <\/span> <\/p>\n<p> <span style=\"color:#bfbfbf\">\u00a0<\/span><br \/>\n <span style=\"color:#6a737d\">#<\/span><br \/>\n <span style=\"color:#6a737d\">\u5343\u4e07\u4e0d\u8981\u5fd8\u8bb0\u6267\u2f8f\u8fd9\u53e5\u547d\u4ee4 <\/span> <\/p>\n<p> <span style=\"color:#6f42c1\">git <\/span><br \/>\n <span style=\"color:#595959\">submodule update <\/span><br \/>\n <span style=\"color:#6f42c1\">&#8211;init<\/span> <\/p>\n<p>  <span style=\"color:#262626\">\u5f3a\u70c8\u5efa\u8bae\u4f7f\u2f64ubuntu16\u6216\u66f4\u65b0\u7248\u672c\u7f16\u8bd1ZLMediaKit&#xff0c;macOS\u662f\u6b21\u9009\u63a8\u8350\u5e73\u53f0&#xff0c;\u6700\u4e0d\u63a8 <\/span> <\/p>\n<p>  <span style=\"color:#262626\">\u8350\u7684\u662fcentos6.*\u6216windows\u5e73\u53f0\u3002<\/span> <\/p>\n<p>  <span style=\"color:#262626\">\u672c\u5730\u5b9e\u9a8c\u4f1a\u5728 ubuntu\u4e0a\u5b9e\u73b0\u3002\u76f8\u5173\u622a\u56fe\u653e\u5728\u540e\u9762<\/span> <\/p>\n<h3><span style=\"color:#262626\">2.\u7f16\u8bd1\u76f8\u5173<\/span><\/h3>\n<h4><span style=\"color:#262626\">2.1 \u7f16\u8bd1\u5668\u7248\u672c\u8981\u6c42 <\/span><\/h4>\n<p>   <span style=\"color:#262626\">ZLMediaKit\u91c7\u2f64\u4e86C&#043;&#043;11\u7684\u8bed\u6cd5\u548c\u5e93&#xff0c;\u8981\u6c42\u7f16\u8bd1\u5668\u2f40\u6301\u5b8c\u6574\u7684C&#043;&#043;11\u6807\u51c6&#xff0c;\u4ea6\u5373&#xff1a; <\/span> <\/p>\n<p>   <span style=\"color:#262626\">linux\u4e0a\u8981\u6c42gcc \u7248\u672c &gt;&#061; 4.8(4.7\u5e94\u8be5\u4e5f\u80fd\u2f40\u6301) <\/span> <\/p>\n<p>   <span style=\"color:#262626\">macOS\u4e0aclang &gt;&#061; ???&#xff08;\u6211\u4e5f\u4e0d\u77e5\u9053&#xff0c;\u4f30\u8ba1\u2f24\u90e8\u5206\u4e0d\u4f1a\u9047\u5230\u8fd9\u4e2a\u95ee\u9898&#xff09; <\/span> <\/p>\n<p>   <span style=\"color:#262626\">windows \u4e0avisual stuido &gt;&#061; 2015(vs2013\u67d0\u4e9b\u7248\u672c\u4e5f\u80fd\u7f16\u8bd1\u901a\u8fc7&#xff0c;\u5982\u679c\u6015\u9ebb\u70e6\u5efa\u8bae\u76f4\u63a5vs2017)<\/span> <\/p>\n<p>\u5728<span style=\"color:#262626\">ubuntu<\/span>\u4e0a\u67e5\u770bg&#043;&#043;\u7248\u672c<\/p>\n<p>g&#043;&#043; &#8211;version<\/p>\n<\/p>\n<h4><span style=\"color:#262626\">2.2 \u5b89\u88c5\u7f16\u8bd1\u5668<\/span><\/h4>\n<p> <span style=\"color:#262626\">\u5982\u679c\u4f60\u662fdebian\u7cfb\u64cd\u4f5c\u7cfb\u7edf(\u5305\u62ecubuntu\u7cfb\u2f64\u6237)&#xff0c;\u2f00\u822c\u2f83\u5e26\u7684gcc\u7248\u672c\u591f\u65b0&#xff0c;\u4f60\u53ef\u4ee5\u8fd9\u6837\u5b89\u88c5gcc\u7f16\u8bd1 \u5668&#xff1a;<\/span> <\/p>\n<p> <span style=\"color:#6f42c1\">sudo <\/span><br \/>\n <span style=\"color:#595959\">apt-get install build-essential<\/span> <\/p>\n<p>  \u4f60\u6b63\u5728\u5c1d\u8bd5\u5728Ubuntu\u6216\u5176\u4ed6\u57fa\u4e8eDebian\u7684Linux\u53d1\u884c\u7248\u4e0a\u5b89\u88c5<br \/>\n build-essential\u5305\u3002<br \/>\n build-essential\u662f\u4e00\u4e2a\u5305\u542b\u7f16\u8bd1\u8f6f\u4ef6\u6240\u9700\u8981\u7684\u57fa\u672c\u5305\u96c6\u5408\u7684\u5143\u5305\u3002\u5b83\u4f1a\u5b89\u88c5GCC\u3001G&#043;&#043;\u3001Make\u7b49\u57fa\u672c\u5de5\u5177&#xff0c;\u8fd9\u4e9b\u5de5\u5177\u662f\u7f16\u8bd1\u5927\u90e8\u5206\u6e90\u4ee3\u7801\u6240\u5fc5\u9700\u7684 <\/p>\n<h4>2.3 \u5b89\u88c5cmake<\/h4>\n<p> <span style=\"color:#262626\">ZLMediaKit\u91c7\u2f64cmake\u6765\u6784\u5efa\u9879\u2f6c&#xff0c;\u901a\u8fc7cmake\u624d\u80fd\u2f63\u6210Makefile(\u6216Xcode\/VS\u2f2f\u7a0b)&#xff0c;\u6240\u4ee5\u5fc5\u987b\u5148\u5b89\u88c5 cmake\u624d\u80fd\u5b8c\u6210\u540e\u7eed\u6b65\u9aa4\u3002 <\/span> <\/p>\n<p> <span style=\"color:#262626\">\u5982\u679c\u4f60\u662fdebian\u7cfb\u64cd\u4f5c\u7cfb\u7edf(\u5305\u62ecubuntu\u7cfb\u2f64\u6237)&#xff0c;\u2f00\u822c\u2f83\u5e26\u7684cmake\u7248\u672c\u591f\u65b0&#xff0c;\u4f60\u53ef\u4ee5\u8fd9\u6837\u5b89\u88c5 <\/span> <\/p>\n<p> <span style=\"color:#262626\">cmake<\/span> <\/p>\n<p>  <span style=\"color:#6f42c1\">sudo <\/span><br \/>\n  <span style=\"color:#595959\">apt-get install cmake<\/span> <\/p>\n<h4>2.4\u00a0<span style=\"color:#262626\">\u4f9d\u8d56\u5e93<\/span><\/h4>\n<\/p>\n<h5><span style=\"color:#262626\">2.4.1 \u4f9d\u8d56\u5e93\u5217\u8868<\/span><\/h5>\n<p>  <span style=\"color:#262626\">ZLMediaKit\u53ef\u9009\u4f9d\u8d56\u2f00\u4e9b\u7b2c\u4e09\u2f45\u5e93&#xff0c;\u8fd9\u4e9b\u5e93\u90fd\u4e0d\u662f\u5fc5\u9009\u7684&#xff1b;\u5728\u6784\u5efaZLMediaKit\u65f6&#xff0c;cmake\u80fd\u67e5\u627e\u7cfb\u7edf\u8def \u5f84\u4e2d\u7684\u8fd9\u4e9b\u5e93&#xff0c;\u5e76\u6839\u636e\u5b89\u88c5\u60c5\u51b5\u9009\u62e9\u662f\u5426\u5f00\u542f\u76f8\u5173\u7279\u6027&#xff0c;\u4f60\u53ef\u4ee5\u9009\u62e9\u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56\u5e76\u542f\u2f64\u76f8\u5173\u7279\u6027&#xff1a;<\/span> <\/p>\n<p>  <span style=\"color:#262626\">openssl <\/span> <\/p>\n<p>  <span style=\"color:#262626\">flash player\u5728\u64ad\u653ertmp\u65f6&#xff0c;\u91c7\u2f64\u7684\u662f\u590d\u6742\u63e1\u2f3f\u6a21\u5f0f&#xff0c;\u5982\u679c\u4e0d\u5b89\u88c5\u8be5\u5e93&#xff0c;flash player\u5c06\u64ad\u653e\u4e0d\u4e86 <\/span> <\/p>\n<p>  <span style=\"color:#262626\">zlmediakit \u63d0\u4f9b\u7684rtmp url. \u540c\u65f6ZLMediaKit\u7684https\/rtsps\u76f8\u5173\u529f\u80fd\u9700\u8981\u4f7f\u2f64openssl\u624d\u80fd\u5f00\u542f\u3002 <\/span> <\/p>\n<p>  <span style=\"color:#262626\">ffmpeg <\/span> <\/p>\n<p>  <span style=\"color:#262626\">zlmediakit\u53ef\u4ee5\u901a\u8fc7fork ffmpeg\u8fdb\u7a0b\u7684\u2f45\u5f0f\u5b9e\u73b0\u591a\u79cd\u534f\u8bae\u7684\u62c9\u6d41&#xff0c;\u7f16\u8bd1\u65f6\u4e0d\u9700\u8981\u5b89\u88c5FFmpeg\u3002 <\/span> <\/p>\n<p>  <span style=\"color:#262626\">sdl\u3001avcodec\u3001avutil <\/span> <\/p>\n<p>  <span style=\"color:#262626\">\u8fd93\u4e2a\u5e93\u4f9bZLMediaKit\u7684test_player\u6d4b\u8bd5\u7a0b\u5e8f\u4f7f\u2f64&#xff0c;\u4f60\u901a\u5e38\u4e0d\u9700\u8981\u5b89\u88c5\u8fd93\u4e2a\u5e93\u3002<\/span> <\/p>\n<h5><span style=\"color:#262626\">2.4.2 \u5b89\u88c5\u4f9d\u8d56\u5e93<\/span><\/h5>\n<\/p>\n<p><span style=\"color:#262626\">Debian\u7cfb(\u5305\u62ecubuntu&#xff09;\u7cfb\u7edf\u4e0b\u5b89\u88c5\u4f9d\u8d56\u7684\u2f45\u6cd5&#xff1a;<\/span><\/p>\n<p> <span style=\"color:#6a737d\">#<\/span><br \/>\n <span style=\"color:#6a737d\">\u9664\u4e86<\/span><br \/>\n <span style=\"color:#6a737d\">openssl,<\/span><br \/>\n <span style=\"color:#6a737d\">\u5176\u4ed6\u5176\u5b9e\u90fd<\/span><br \/>\n <span style=\"color:#fe2c24\">\u53ef\u4ee5\u4e0d\u5b89\u88c5 <\/span> <\/p>\n<p> <span style=\"color:#fe2c24\">sudo apt update sudo apt-get install openssl<\/span> <\/p>\n<p> <span style=\"color:#bfbfbf\">\u00a0<\/span><br \/>\n <span style=\"color:#6f42c1\">sudo <\/span><br \/>\n <span style=\"color:#595959\">apt-get install libssl-dev <\/span> <\/p>\n<p> <span style=\"color:#bfbfbf\">\u00a0<\/span><br \/>\n <span style=\"color:#6f42c1\">sudo <\/span><br \/>\n <span style=\"color:#595959\">apt-get install libsdl-dev <\/span> <\/p>\n<p> <span style=\"color:#bfbfbf\">\u00a0<\/span><br \/>\n <span style=\"color:#6f42c1\">sudo <\/span><br \/>\n <span style=\"color:#595959\">apt-get install libavcodec-dev <\/span> <\/p>\n<p> <span style=\"color:#bfbfbf\">\u00a0<\/span><br \/>\n <span style=\"color:#6f42c1\">sudo <\/span><br \/>\n <span style=\"color:#595959\">apt-get install libavutil-dev <\/span> <\/p>\n<p> <span style=\"color:#bfbfbf\">\u00a0<\/span><br \/>\n <span style=\"color:#6f42c1\">sudo <\/span><br \/>\n <span style=\"color:#595959\">apt-get install ffmpeg<\/span> <\/p>\n<h4><span style=\"color:#262626\">2.5 \u6784\u5efa\u548c\u7f16\u8bd1\u9879\u2f6c<\/span><\/h4>\n<p>  <span style=\"color:#262626\">\u5728linux\u6216macOS\u7cfb\u7edf\u4e0b,\u4f60\u5e94\u8be5\u8fd9\u6837\u64cd\u4f5c&#xff1a;<\/span> <\/p>\n<p>  1 cd ZLMediaKit<br \/>\n2 mkdir build<br \/>\n3 cd build<br \/>\n4 #macOS\u4e0b\u53ef\u80fd\u9700\u8981\u8fd9\u6837\u6307\u5b9aopenss\u8def\u5f84&#xff1a;cmake .. -DOPENSSL_ROOT_DIR&#061;\/usr\/lo<br \/>\ncal\/Cellar\/openssl\/1.0.2j\/<br \/>\n5 cmake ..<br \/>\n6 make -j4 <\/p>\n<h3><span style=\"color:#262626\">3\u00a0 \u8fd0\u2f8f<\/span><\/h3>\n<p> <span style=\"color:#262626\">ZLMediaKit\u2f2f\u7a0b\u4e3b\u8981\u2f63\u62103\u79cd\u2f06\u8fdb\u5236\u2f6c\u6807\u2f42\u4ef6&#xff0c;\u4ed6\u4eec\u7684\u2f63\u6210\u7684\u8def\u5f84\u5728release\u2f6c\u5f55\u4e0b&#xff0c;\u8fd9\u4e9b\u2f6c\u6807\u2f42\u4ef6\u4e3b\u8981\u5206\u4e3a&#xff1a;<\/span> <\/p>\n<p>  <span style=\"color:#262626\">MediaServer\u8fdb\u7a0b\u8fd9\u662fZLMediaKit\u4f5c\u4e3a\u670d\u52a1\u5668\u7684\u4e3b\u8fdb\u7a0b&#xff0c;\u8be5\u8fdb\u7a0b\u53ef\u4ee5\u5728\u514d\u53bb\u5f00\u53d1\u7684\u60c5\u51b5\u4e0b\u76f4\u63a5\u4f5c\u4e3a\u6d4b \u8bd5\u6d41\u5a92\u4f53\u670d\u52a1\u5668\u4f7f\u2f64&#xff0c;\u5982\u679c\u4f60\u9700\u8981\u66f4\u590d\u6742\u7684\u4e1a\u52a1\u903b\u8f91&#xff0c;\u53ef\u4ee5\u901a\u8fc7<\/span><br \/>\n  <span style=\"color:#096dd9\">Web HOOK<\/span><br \/>\n  <span style=\"color:#262626\">\u548c<\/span><br \/>\n  <span style=\"color:#096dd9\">RESTful API<\/span><br \/>\n  <span style=\"color:#262626\">\u5b9e\u73b0,\u540c\u65f6 \u4f60\u53ef\u4ee5\u901a\u8fc7<\/span><br \/>\n  <span style=\"color:#096dd9\">\u914d\u7f6e\u2f42\u4ef6<\/span><br \/>\n  <span style=\"color:#262626\">\u63a7\u5236\u5176\u53c2\u6570\u3002<\/span> <\/p>\n<p>1 cd ZLMediaKit\/release\/linux\/Debug<br \/>\n2 #\u901a\u8fc7-h\u53ef\u4ee5\u4e86\u89e3\u542f\u52a8\u53c2\u6570<br \/>\n3 .\/MediaServer -h<br \/>\n4 #\u4ee5\u5b88\u62a4\u8fdb\u7a0b\u6a21\u5f0f\u542f\u52a8<br \/>\n5 .\/MediaServer -d &amp; <\/p>\n<\/p>\n<h2>2.\u672c\u5730\u5b9e\u9a8c\u7684\u622a\u56fe\u548c\u8bf4\u660e<\/h2>\n<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"184\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105435-68022f6b93dd0.png\" width=\"878\" \/><\/p>\n<\/p>\n<h3>\u4e0b\u8f7d ZLMediaKit<\/h3>\n<\/p>\n<p> <span style=\"color:#6f42c1\">git <\/span><br \/>\n <span style=\"color:#595959\">clone <\/span><br \/>\n <span style=\"color:#6f42c1\">&#8211;depth <\/span><br \/>\n <span style=\"color:#005cc5\">1 <\/span><br \/>\n <span style=\"color:#595959\">https:\/\/gitee.com\/xia-chu\/ZLMediaKit.git <\/span> <\/p>\n<p> <span style=\"color:#6f42c1\">cd <\/span><br \/>\n <span style=\"color:#595959\">ZLMediaKit <\/span> <\/p>\n<p> <span style=\"color:#bfbfbf\">\u00a0<\/span><br \/>\n <span style=\"color:#6a737d\">#<\/span><br \/>\n <span style=\"color:#6a737d\">\u5343\u4e07\u4e0d\u8981\u5fd8\u8bb0\u6267\u2f8f\u8fd9\u53e5\u547d\u4ee4 <\/span> <\/p>\n<p> <span style=\"color:#6f42c1\">git <\/span><br \/>\n <span style=\"color:#595959\">submodule update <\/span><br \/>\n <span style=\"color:#6f42c1\">&#8211;init<\/span> <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"624\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105435-68022f6badf51.png\" width=\"929\" \/> <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"624\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105435-68022f6be0fbe.png\" width=\"936\" \/><\/p>\n<\/p>\n<h3>cd ZLMediaKit<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"69\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105436-68022f6c20fd5.png\" width=\"791\" \/><\/p>\n<\/p>\n<\/p>\n<\/p>\n<h3>\u5728<span style=\"color:#262626\">ubuntu<\/span>\u4e0a\u67e5\u770bg&#043;&#043;\u7248\u672c<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"144\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105436-68022f6c3190b.png\" width=\"926\" \/><\/p>\n<\/p>\n<p><span style=\"color:#262626\">linux\u4e0a\u8981\u6c42gcc \u7248\u672c &gt;&#061; 4.8(4.7\u5e94\u8be5\u4e5f\u80fd\u2f40\u6301)&#xff0c;\u672c\u5730\u5b89\u88c5\u7684ubuntu \u662f\u7b26\u5408\u6807\u51c6\u7684&#xff0c;\u56e0\u6b64<\/span><\/p>\n<\/p>\n<h3><span style=\"color:#262626\">\u5b89\u88c5\u7f16\u8bd1\u5668<\/span><\/h3>\n<p> <span style=\"color:#262626\">\u5982\u679c\u4f60\u662fdebian\u7cfb\u64cd\u4f5c\u7cfb\u7edf(\u5305\u62ecubuntu\u7cfb\u2f64\u6237)&#xff0c;\u2f00\u822c\u2f83\u5e26\u7684gcc\u7248\u672c\u591f\u65b0&#xff0c;\u4f60\u53ef\u4ee5\u8fd9\u6837\u5b89\u88c5gcc\u7f16\u8bd1 \u5668&#xff1a;<\/span> <\/p>\n<p> <span style=\"color:#6f42c1\">sudo <\/span><br \/>\n <span style=\"color:#595959\">apt-get install build-essential<\/span> <\/p>\n<p> build-essential\u662f\u4e00\u4e2a\u5305\u542b\u7f16\u8bd1\u8f6f\u4ef6\u6240\u9700\u8981\u7684\u57fa\u672c\u5305\u96c6\u5408\u7684\u5143\u5305\u3002\u5b83\u4f1a\u5b89\u88c5GCC\u3001G&#043;&#043;\u3001Make\u7b49\u57fa\u672c\u5de5\u5177&#xff0c;\u8fd9\u4e9b\u5de5\u5177\u662f\u7f16\u8bd1\u5927\u90e8\u5206\u6e90\u4ee3\u7801\u6240\u5fc5\u9700\u7684 <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"248\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105436-68022f6c45541.png\" width=\"928\" \/> <\/p>\n<h3>\u5b89\u88c5cmake<\/h3>\n<p>  <span style=\"color:#262626\">ZLMediaKit\u91c7\u2f64cmake\u6765\u6784\u5efa\u9879\u2f6c&#xff0c;\u901a\u8fc7cmake\u624d\u80fd\u2f63\u6210Makefile(\u6216Xcode\/VS\u2f2f\u7a0b)&#xff0c;\u6240\u4ee5\u5fc5\u987b\u5148\u5b89\u88c5 cmake\u624d\u80fd\u5b8c\u6210\u540e\u7eed\u6b65\u9aa4\u3002 <\/span> <\/p>\n<p>  <span style=\"color:#262626\">\u5982\u679c\u4f60\u662fdebian\u7cfb\u64cd\u4f5c\u7cfb\u7edf(\u5305\u62ecubuntu\u7cfb\u2f64\u6237)&#xff0c;\u2f00\u822c\u2f83\u5e26\u7684cmake\u7248\u672c\u591f\u65b0&#xff0c;\u4f60\u53ef\u4ee5\u8fd9\u6837\u5b89\u88c5 <\/span> <\/p>\n<p>  <span style=\"color:#262626\">cmake<\/span> <\/p>\n<p>   <span style=\"color:#6f42c1\">sudo <\/span><br \/>\n   <span style=\"color:#595959\">apt-get install cmake<\/span> <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"211\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105436-68022f6c60122.png\" width=\"935\" \/> <\/p>\n<h3><span style=\"color:#262626\">\u5b89\u88c5\u4f9d\u8d56\u5e93&#xff0c;\u8fd9\u91cc\u53ea\u662f\u5b89\u88c5\u4e86<\/span><span style=\"color:#fe2c24\">openssl<\/span><\/h3>\n<p> <span style=\"color:#fe2c24\">sudo apt update sudo apt-get install openssl<\/span> <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"417\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105436-68022f6c79740.png\" width=\"940\" \/> <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"616\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105436-68022f6c9fe5a.png\" width=\"927\" \/> <\/p>\n<h3>\u6784\u5efa\u548c\u7f16\u8bd1\u9879\u2f6c<\/h3>\n<p> 1 cd ZLMediaKit<br \/>\n2 mkdir build<br \/>\n3 cd build<br \/>\n4 #macOS\u4e0b\u53ef\u80fd\u9700\u8981\u8fd9\u6837\u6307\u5b9aopenss\u8def\u5f84&#xff1a;cmake .. -DOPENSSL_ROOT_DIR&#061;\/usr\/lo<br \/>\ncal\/Cellar\/openssl\/1.0.2j\/<br \/>\n5 cmake ..<br \/>\n6 make -j4 <\/p>\n<\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"625\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105436-68022f6cd55c2.png\" width=\"936\" \/> <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"627\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105437-68022f6d1828a.png\" width=\"932\" \/> <\/p>\n<p>  \u6328\u4e2a\u68c0\u67e5\u662f\u4e0d\u662f100% build \u6210\u529f&#xff0c; <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"620\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105437-68022f6d49d10.png\" width=\"937\" \/> <\/p>\n<h2>3.\u8fd0\u884cMediaServer<\/h2>\n<\/p>\n<p>.\/MediaServer\u00a0 .\/MediaServer \u00a0-d .\/MediaServer \u00a0-d &amp; nohup .\/MediaServer -d &amp;<\/p>\n<ul>\n<li>\u6ce8\u610f&#xff1a;\n<ul>\n<li>\u5982\u679c\u4f60\u542f\u52a8MediaServer\u540e\u9700\u8981\u5173\u95edshell&#xff0c;\u7528\u7b2c\u4e09\u79cd\u65b9\u5f0f,\u5426\u5219\u5173\u95edshell\u4f1a\u5bfc\u81f4MediaServer\u4e00\u8d77\u88ab\u5173\u95ed\u3002<\/li>\n<li>\u5982\u679c\u4f60\u4f1a\u4f7f\u7528\u5230FFmpeg\u76f8\u5173\u529f\u80fd&#xff0c;\u4f60\u5e94\u8be5\u8fd9\u6837\u542f\u52a8\u7a0b\u5e8fnohup .\/MediaServer -d &amp;&#xff0c;\u5426\u5219\u5728fork FFmpeg\u8fdb\u7a0b\u65f6\u4f1a\u5bfc\u81f4MediaServer\u8fdb\u7a0b\u6302\u8d77\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p> \u00a0<\/p>\n<ul>\n<li>-d(\u2013daemon)&#xff1a;\u662f\u5426\u4ee5\u5b88\u62a4\u7a0b\u5e8f\u7684\u65b9\u5f0f\u542f\u52a8&#xff0c;\u5b88\u62a4\u8fdb\u7a0b\u53ea\u505a\u4e00\u4ef6\u4e8b&#xff0c;\u5c31\u662f\u5224\u65ad\u5b50\u8fdb\u7a0b(\u8fd9\u4e2a\u624d\u662f\u5e72\u6d3b\u7684\u8fdb\u7a0b)\u662f\u5426\u5df2\u7ecf\u9000\u51fa&#xff0c;\u9000\u51fa\u540e\u4f1a\u4e0d\u65ad\u5c1d\u8bd5\u91cd\u542f\u5b50\u8fdb\u7a0b<\/li>\n<li>-l(\u2013level): \u6307\u5b9a\u65e5\u5fd7\u6253\u5370\u7b49\u7ea7&#xff0c;\u8d4b\u503c\u8303\u56f4\u4e3a0~4&#xff0c;\u7b49\u7ea7\u8d8a\u9ad8&#xff0c;\u65e5\u5fd7\u8d8a\u5c11\u3002<\/li>\n<li>-m(\u2013max_day): \u65e5\u5fd7\u6587\u4ef6\u4fdd\u5b58\u5929\u6570&#xff0c;\u7a0b\u5e8f\u672c\u6b21\u8fd0\u884c\u671f\u95f4\u7684\u65e5\u5fd7\u5982\u679c\u8d85\u8fc7\u8fd9\u4e2a\u5929\u6570&#xff0c;\u5c31\u4f1a\u88ab\u5220\u9664\u3002<\/li>\n<li>-c(\u2013config): \u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u8def\u5f84&#xff0c;\u914d\u7f6e\u6587\u4ef6\u4e3aini\u683c\u5f0f<\/li>\n<li>-s(\u2013ssl): \u6307\u5b9assl\u8bc1\u4e66\u8def\u5f84&#xff0c;\u8bc1\u4e66\u683c\u5f0f\u652f\u6301p12\u548cpem\u7c7b\u578b&#xff0c;\u91cc\u9762\u5fc5\u987b\u5305\u542b\u516c\u94a5\u548c\u79c1\u94a5&#xff0c;\u79c1\u94a5\u4e0d\u80fd\u6709\u52a0\u5bc6\u5bc6\u7801\u3002\u5982\u679c\u6307\u5b9a\u6587\u4ef6\u5939&#xff0c;\u4f1a\u52a0\u8f7d\u6587\u4ef6\u5939\u4e0b\u6240\u6709\u8bc1\u4e66\u3002<\/li>\n<li>-t(\u2013threads): \u6307\u5b9a\u4e8b\u4ef6\u9a71\u52a8\u7ebf\u7a0b(\u5e72\u91cd\u6d3b)\u548c\u540e\u53f0\u5de5\u4f5c\u7ebf\u7a0b(\u5e72\u963b\u585e\u7684\u6d3b)\u4e2a\u6570\u3002<\/li>\n<\/ul>\n<\/p>\n<p>  .\/MediaServer -h \u67e5\u770b\u542f\u52a8\u53c2\u6570 <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"606\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105437-68022f6d7f226.png\" width=\"1200\" \/> <\/p>\n<p>  .\/MediaServer -d &amp; \u4ee5\u5b88\u62a4\u8fdb\u7a0b\u6a21\u5f0f\u542f\u52a8 <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"609\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105438-68022f6e03235.png\" width=\"1200\" \/> <\/p>\n<h4>1. \u9519\u8bef\u6392\u67e5&#xff0c;\u539f\u56e0\u662f \u7aef\u53e3\u53f7 554 \u88ab\u5360\u7528<\/h4>\n<h4>2. \u4f7f\u7528\u00a0sudo lsof -i:554 \u00a0\u67e5\u770b554\u7aef\u53e3\u88ab\u90a3\u4e2a \u7a0b\u5e8f\u5360\u7528\u4e86<\/h4>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"619\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105438-68022f6e8383e.png\" width=\"934\" \/> <\/p>\n<h4>3.\u4f7f\u7528 sudo kill -9 xxxxx \u5c06 \u5360\u7528\u8be5\u7aef\u53e3\u7684\u6740\u6b7b<\/h4>\n<p>  \u6ce8\u610f&#xff0c;\u5728\u6740\u6b7b\u5360\u7528554 \u7aef\u53e3\u7684 \u8fdb\u7a0b\u524d&#xff0c;.\/MediaServer -d &amp; \u547d\u4ee4\u884c\u7684\u72b6\u6001 <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1040\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105438-68022f6eb6907.png\" width=\"1200\" \/> <\/p>\n<p>  \u6309\u4e0b\u56de\u8f66\u540e\u7684\u72b6\u6001&#xff0c;\u6b63\u5e38\u542f\u52a8\u4e86\u3002 <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1017\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105439-68022f6fb0d89.png\" width=\"1200\" \/> <\/p>\n<p>  \u7136\u540e\u6211\u4eec\u518d\u5c06\u00a0\u4f7f\u7528\u00a0sudo lsof -i:554 \u00a0\u67e5\u770b554\u7aef\u53e3\u88ab\u90a3\u4e2a \u7a0b\u5e8f\u5360\u7528\u4e86&#xff0c; <\/p>\n<p>  \u7136\u540e\u518d\u4f7f\u7528\u00a0sudo kill -9 xxx \u5c06 \u5360\u7528\u8be5\u7aef\u53e3\u7684\u6740\u6b7b <\/p>\n<p>  \u00a0\u4f7f\u7528\u00a0sudo lsof -i:554 \u00a0\u67e5\u770b554\u7aef\u53e3 \u4f1a\u53d1\u73b0&#xff0c;.\/MediaServer -d &amp; \u7684\u8fdb\u7a0b\u53f7\u662f 10503 <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1071\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105440-68022f7097aa1.png\" width=\"1200\" \/> <\/p>\n<p>  \u7136\u540e\u518d\u4f7f\u7528\u00a0sudo kill -9 10503 \u5c06 \u5360\u7528\u8be5\u7aef\u53e3\u7684\u6740\u6b7b&#xff0c;\u4f1a\u53d1\u73b0\u00a0.\/MediaServer -d &amp; \u4f1a\u91cd\u542f\u3002 <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1078\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105441-68022f717bc76.png\" width=\"1200\" \/> <\/p>\n<h4>4. debug\u76ee\u5f55\u4e0b\u7684config.ini \u6539\u52a8\u53c2\u6570\u00a0<\/h4>\n<p>  log \u5f88\u91cd\u8981&#xff0c;\u8981\u770blog&#xff0c; <\/p>\n<p>  \u6709\u53ef\u80fd\u5176\u4ed6\u7684\u7aef\u53e3\u4e5f\u4f1a\u5360\u7528\u4e86&#xff0c;\u5047\u8bbe\u4f60\u8fd8\u5b89\u88c5\u4e86 \u5176\u4ed6\u7684 server&#xff0c;sql server&#xff0c;tomcat\u7b49\u670d\u52a1\u5668&#xff0c;\u90a3\u4e48\u88ab\u5360\u7528\u7aef\u53e3\u662f\u5f88\u53ef\u80fd\u7684\u4e8b\u60c5\u3002 <\/p>\n<p>  \u5982\u679c\u60f3\u6539\u52a8 ZLMediaKit\u7684\u7aef\u53e3&#xff0c;\u8bf7 \u5728config.ini \u4e2d\u6539\u52a8\u53c2\u6570 <\/p>\n<p> ; auto-generated by mINI class {<\/p>\n<p>[api]<br \/>\napiDebug&#061;1<br \/>\ndefaultSnap&#061;.\/www\/logo.png<br \/>\ndownloadRoot&#061;.\/www<br \/>\nsecret&#061;nXIB3CEQY1nAtaoDoe0JSwNCNakR3asa<br \/>\nsnapRoot&#061;.\/www\/snap\/<\/p>\n<p>[cluster]<br \/>\norigin_url&#061;<br \/>\nretry_count&#061;3<br \/>\ntimeout_sec&#061;15<\/p>\n<p>[ffmpeg]<br \/>\nbin&#061;\/usr\/bin\/ffmpeg<br \/>\ncmd&#061;%s -re -i %s -c:a aac -strict -2 -ar 44100 -ab 48k -c:v libx264 -f flv %s<br \/>\nlog&#061;.\/ffmpeg\/ffmpeg.log<br \/>\nrestart_sec&#061;0<br \/>\nsnap&#061;%s -i %s -y -f mjpeg -frames:v 1 -an %s<\/p>\n<p>[general]<br \/>\nbroadcast_player_count_changed&#061;0<br \/>\ncheck_nvidia_dev&#061;1<br \/>\nenableVhost&#061;0<br \/>\nenable_ffmpeg_log&#061;0<br \/>\nflowThreshold&#061;1024<br \/>\nlisten_ip&#061;::<br \/>\nmaxStreamWaitMS&#061;15000<br \/>\nmediaServerId&#061;your_server_id<br \/>\nmergeWriteMS&#061;0<br \/>\nresetWhenRePlay&#061;1<br \/>\nstreamNoneReaderDelayMS&#061;20000<br \/>\nunready_frame_cache&#061;100<br \/>\nwait_add_track_ms&#061;3000<br \/>\nwait_audio_track_data_ms&#061;1000<br \/>\nwait_track_ready_ms&#061;10000<\/p>\n<p>[hls]<br \/>\nbroadcastRecordTs&#061;0<br \/>\ndeleteDelaySec&#061;10<br \/>\nfastRegister&#061;0<br \/>\nfileBufSize&#061;65536<br \/>\nsegDelay&#061;0<br \/>\nsegDur&#061;2<br \/>\nsegKeep&#061;0<br \/>\nsegNum&#061;3<br \/>\nsegRetain&#061;5<\/p>\n<p>[hook]<br \/>\nalive_interval&#061;10.0<br \/>\nenable&#061;0<br \/>\non_flow_report&#061;<br \/>\non_http_access&#061;<br \/>\non_play&#061;<br \/>\non_publish&#061;<br \/>\non_record_mp4&#061;<br \/>\non_record_ts&#061;<br \/>\non_rtp_server_timeout&#061;<br \/>\non_rtsp_auth&#061;<br \/>\non_rtsp_realm&#061;<br \/>\non_send_rtp_stopped&#061;<br \/>\non_server_exited&#061;<br \/>\non_server_keepalive&#061;<br \/>\non_server_started&#061;<br \/>\non_shell_login&#061;<br \/>\non_stream_changed&#061;<br \/>\non_stream_none_reader&#061;<br \/>\non_stream_not_found&#061;<br \/>\nretry&#061;1<br \/>\nretry_delay&#061;3.0<br \/>\nstream_changed_schemas&#061;rtsp\/rtmp\/fmp4\/ts\/hls\/hls.fmp4<br \/>\ntimeoutSec&#061;10<\/p>\n<p>[http]<br \/>\nallow_cross_domains&#061;1<br \/>\nallow_ip_range&#061;::1,127.0.0.1,172.16.0.0-172.31.255.255,192.168.0.0-192.168.255.255,10.0.0.0-10.255.255.255<br \/>\ncharSet&#061;utf-8<br \/>\ndirMenu&#061;1<br \/>\nforbidCacheSuffix&#061;<br \/>\nforwarded_ip_header&#061;<br \/>\nkeepAliveSecond&#061;30<br \/>\nmaxReqSize&#061;40960<br \/>\nnotFound&#061;&lt;html&gt;&lt;head&gt;&lt;title&gt;404 Not Found&lt;\/title&gt;&lt;\/head&gt;&lt;body bgcolor&#061;&#034;white&#034;&gt;&lt;center&gt;&lt;h1&gt;\u60a8\u8bbf\u95ee\u7684\u8d44\u6e90\u4e0d\u5b58\u5728&#xff01;&lt;\/h1&gt;&lt;\/center&gt;&lt;hr&gt;&lt;center&gt;ZLMediaKit(git hash:8bf48ed\/2024-12-15T11:43:31&#043;08:00,branch:master,build time:2024-12-19T12:43:26)&lt;\/center&gt;&lt;\/body&gt;&lt;\/html&gt;<br \/>\nport&#061;80<br \/>\nrootPath&#061;.\/www<br \/>\nsendBufSize&#061;65536<br \/>\nsslport&#061;443<br \/>\nvirtualPath&#061;<\/p>\n<p>[multicast]<br \/>\naddrMax&#061;239.255.255.255<br \/>\naddrMin&#061;239.0.0.0<br \/>\nudpTTL&#061;64<\/p>\n<p>[protocol]<br \/>\nadd_mute_audio&#061;1<br \/>\nauto_close&#061;0<br \/>\ncontinue_push_ms&#061;15000<br \/>\nenable_audio&#061;1<br \/>\nenable_fmp4&#061;1<br \/>\nenable_hls&#061;1<br \/>\nenable_hls_fmp4&#061;0<br \/>\nenable_mp4&#061;0<br \/>\nenable_rtmp&#061;1<br \/>\nenable_rtsp&#061;1<br \/>\nenable_ts&#061;1<br \/>\nfmp4_demand&#061;0<br \/>\nhls_demand&#061;0<br \/>\nhls_save_path&#061;.\/www<br \/>\nmodify_stamp&#061;2<br \/>\nmp4_as_player&#061;0<br \/>\nmp4_max_second&#061;3600<br \/>\nmp4_save_path&#061;.\/www<br \/>\npaced_sender_ms&#061;0<br \/>\nrtmp_demand&#061;0<br \/>\nrtsp_demand&#061;0<br \/>\nts_demand&#061;0<\/p>\n<p>[record]<br \/>\nappName&#061;record<br \/>\nenableFmp4&#061;0<br \/>\nfastStart&#061;0<br \/>\nfileBufSize&#061;65536<br \/>\nfileRepeat&#061;0<br \/>\nsampleMS&#061;500<\/p>\n<p>[rtc]<br \/>\nexternIP&#061;<br \/>\nmaxRtpCacheMS&#061;5000<br \/>\nmaxRtpCacheSize&#061;2048<br \/>\nmax_bitrate&#061;0<br \/>\nmin_bitrate&#061;0<br \/>\nnackIntervalRatio&#061;1.0<br \/>\nnackMaxCount&#061;15<br \/>\nnackMaxMS&#061;3000<br \/>\nnackMaxSize&#061;2048<br \/>\nnackRtpSize&#061;8<br \/>\nport&#061;8000<br \/>\npreferredCodecA&#061;PCMA,PCMU,opus,mpeg4-generic<br \/>\npreferredCodecV&#061;H264,H265,AV1,VP9,VP8<br \/>\nrembBitRate&#061;0<br \/>\nstart_bitrate&#061;0<br \/>\ntcpPort&#061;8000<br \/>\ntimeoutSec&#061;15<\/p>\n<p>[rtmp]<br \/>\ndirectProxy&#061;1<br \/>\nenhanced&#061;0<br \/>\nhandshakeSecond&#061;15<br \/>\nkeepAliveSecond&#061;15<br \/>\nport&#061;1935<br \/>\nsslport&#061;0<\/p>\n<p>[rtp]<br \/>\naudioMtuSize&#061;600<br \/>\nh264_stap_a&#061;1<br \/>\nlowLatency&#061;0<br \/>\nrtpMaxSize&#061;10<br \/>\nvideoMtuSize&#061;1400<\/p>\n<p>[rtp_proxy]<br \/>\ndumpDir&#061;<br \/>\ngop_cache&#061;1<br \/>\nh264_pt&#061;98<br \/>\nh265_pt&#061;99<br \/>\nopus_pt&#061;100<br \/>\nport&#061;10000<br \/>\nport_range&#061;30000-35000<br \/>\nps_pt&#061;96<br \/>\nrtp_g711_dur_ms&#061;100<br \/>\ntimeoutSec&#061;15<br \/>\nudp_recv_socket_buffer&#061;4194304<\/p>\n<p>[rtsp]<br \/>\nauthBasic&#061;0<br \/>\ndirectProxy&#061;1<br \/>\nhandshakeSecond&#061;15<br \/>\nkeepAliveSecond&#061;15<br \/>\nlowLatency&#061;0<br \/>\nport&#061;554<br \/>\nrtpTransportType&#061;-1<br \/>\nsslport&#061;0<\/p>\n<p>[shell]<br \/>\nmaxReqSize&#061;1024<br \/>\nport&#061;0<\/p>\n<p>[srt]<br \/>\nlatencyMul&#061;4<br \/>\npktBufSize&#061;8192<br \/>\nport&#061;9000<br \/>\ntimeoutSec&#061;5<\/p>\n<p>; } &#8212; <\/p>\n<h2>4. ZLMediaKit \u5df2\u7ecf\u542f\u52a8&#xff0c;\u4f7f\u7528ffmpeg \u547d\u4ee4 \u7ed9\u8be5\u670d\u52a1\u5668\u4e0a \u63a8\u6d41\u6570\u636e<\/h2>\n<p>  <span style=\"color:#262626\">ZLMediaKit\u2f40\u6301rtsp\/rtmp\/rtp\u63a8\u6d41&#xff0c;<\/span> <\/p>\n<h3><span style=\"color:#262626\">1\u3001\u4f7f\u2f64rtsp\u2f45\u5f0f\u63a8\u6d41&#xff0c;\u6211\u4eec\u8fd9\u4e00\u8282\u5b66\u8fd9\u4e2a<\/span><\/h3>\n<p>  1 # h264\u63a8\u6d41<br \/>\n2 ffmpeg -re -i &#034;\/path\/to\/test.mp4&#034; -vcodec h264 -acodec aac -f rtsp<br \/>\n-rtsp_transport tcp rtsp:\/\/127.0.0.1\/live\/test<br \/>\n3 # h265\u63a8\u6d41<br \/>\n4 ffmpeg -re -i &#034;\/path\/to\/test.mp4&#034; -vcodec h265 -acodec aac -f rtsp<br \/>\n-rtsp_transport tcp rtsp:\/\/127.0.0.1\/live\/test <\/p>\n<p>ffmpeg -re -i &#034;\/path\/to\/test.mp4&#034; -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp:\/\/127.0.0.1\/live\/test<\/p>\n<\/p>\n<p>\u5982\u4e0b\u7684\u63a8\u6d41\u8bf4\u660e&#xff1a;<\/p>\n<p>\u6211\u4eec\u5c06D:\/resource\/zerenlian.mp4 \u8fd9\u4e2a\u6587\u4ef6\u63a8\u6d41\u5230 ZLmediakit \u670d\u52a1\u5668&#xff1b;<\/p>\n<p>\u8be5\u6587\u4ef6\u7684 \u89c6\u9891\u683c\u5f0f\u4e3a\u00a0 \u00a0 -vcodec h264<\/p>\n<p>\u8be5\u6587\u4ef6\u7684 \u97f3\u9891\u683c\u5f0f\u4e3a\u00a0 \u00a0 \u00a0-acodec aac<\/p>\n<p>\u63a8\u6d41\u7684\u65b9\u5f0f\u662frtsp\u00a0 \u00a0\u00a0\u00a0 -f rtsp\u00a0<\/p>\n<p>\u63a8\u6d41\u662f\u7528tcp \u7684\u4f20\u9001\u7684\u00a0 \u00a0 \u00a0 -rtsp_transport tcp<\/p>\n<\/p>\n<p>\u670d\u52a1\u5668\u7684\u5730\u5740\u5199\u6cd5\u5982\u4e0b&#xff1a;<\/p>\n<p>rtsp:\/\/192.168.31.103\/test\/00000001zerenlian<\/p>\n<\/p>\n<p>rtsp:\/\/\u00a0 \u4ee3\u8868\u7684\u56fa\u5b9a\u683c\u5f0f&#xff0c;\u5982\u679crtsp \u683c\u5f0f \u5c31\u5fc5\u987b\u8fd9\u4e48\u5199 \u3002<\/p>\n<p>192.168.31.103 \u662flinux\u670d\u52a1\u5668\u7684IP\u3002<\/p>\n<p>test\/00000001zerenlian \u662f\u81ea\u5df1\u547d\u540d\u7684&#xff0c;\u5bf9\u4e8e\u00a0D:\/resource\/zerenlian.mp4 \u6587\u4ef6\u7684\u6620\u5c04\u3002<\/p>\n<\/p>\n<p>ffmpeg -re -i &#034;D:\/resource\/zerenlian.mp4&#034; -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp:\/\/192.168.31.103\/test\/00000001zerenlian \u00a0<\/p>\n<\/p>\n<h3><span style=\"color:#262626\">2.\u4f7f\u2f64rtmp\u2f45\u5f0f\u63a8\u6d41<\/span><\/h3>\n<p>   1 #\u5982\u679c\u672a\u5b89\u88c5FFmpeg&#xff0c;\u4f60\u4e5f\u53ef\u4ee5\u2f64obs\u63a8\u6d41<br \/>\n2 ffmpeg -re -i &#034;\/path\/to\/test.mp4&#034; -vcodec h264 -acodec aac -f flv<br \/>\nrtmp:\/\/127.0.0.1\/live\/test<br \/>\n3 # RTMP\u6807\u51c6\u4e0d\u2f40\u6301H265,\u4f46\u662f\u56fd\u5185\u6709\u2f83\u2f8f\u6269\u5c55\u7684&#xff0c;\u5982\u679c\u4f60\u60f3\u8ba9FFmpeg\u2f40\u6301RTMP-H265,\u8bf7<br \/>\n\u6309\u7167\u6b64\u2f42\u7ae0\u7f16\u8bd1&#xff1a;https:\/\/github.com\/ksvc\/FFmpeg\/wiki\/hevcpush <\/p>\n<h3><span style=\"color:#262626\">3.\u4f7f\u2f64rtp\u2f45\u5f0f\u63a8\u6d41<\/span><\/h3>\n<p>   1 # h264\u63a8\u6d41<br \/>\n2 ffmpeg -re -i &#034;\/path\/to\/test.mp4&#034; -vcodec h264 -acodec aac -f rtp_mpegts rtp:\/\/127.0.0.1:10000<br \/>\n3 # h265\u63a8\u6d41<br \/>\n4 ffmpeg -re -i &#034;\/path\/to\/test.mp4&#034; -vcodec h265 -acodec aac -f rtp_mpegts rtp:\/\/127.0.0.1:10000 <\/p>\n<p>1 # h264\u63a8\u6d41 2 ffmpeg -re -i &#034;\/path\/to\/test.mp4&#034; -vcodec h264 -acodec aac -f rtp_mpegts rtp:\/\/127.0.0.1:10000 3 # h265\u63a8\u6d41 4 ffmpeg -re -i &#034;\/path\/to\/test.mp4&#034; -vcodec h265 -acodec aac -f rtp_mpegts rtp:\/\/127.0.0.1:10000<\/p>\n<\/p>\n<p>\u5148\u67e5\u770blinux\u7684ip&#xff0c;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"477\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105442-68022f7262326.png\" width=\"933\" \/><\/p>\n<\/p>\n<\/p>\n<h2>5.\u00a0ZLMediaKit \u5df2\u7ecf\u542f\u52a8&#xff0c;\u4f7f\u7528ffplay \u547d\u4ee4\u4ece\u8be5\u670d\u52a1\u5668\u4e0a \u62c9\u6d41\u6570\u636e<\/h2>\n<p><span style=\"color:#262626\">\u4f7f\u7528 rtsp\u2f45\u5f0f\u62c9\u6d41<\/span><\/p>\n<p>ffplay -rtsp_transport tcp rtsp:\/\/192.168.31.103\/test\/00000001zerenlian<\/p>\n<p> ffplay -rtsp_transport tcp rtsp:\/\/192.168.31.103\/test\/00000001zerenlian <\/p>\n<p>\u5982\u679c\u6211\u4eec\u4f7f\u7528 udp\u7684\u5f62\u5f0f\u53bb\u62c9\u5462&#xff1f;\u5b9e\u9645\u6d4b\u8bd5\u4e5f\u662f\u53ef\u4ee5\u7684<\/p>\n<p>ffplay -rtsp_transport udp rtsp:\/\/192.168.31.103\/test\/00000001zerenlian<\/p>\n<h2 style=\"background-color:transparent\">6 log \u5728\u8fd9\u91cc<\/h2>\n<p>  \/home\/hunandede\/software\/ZLMediaKit\/release\/linux\/Debug\/log <\/p>\n<h2 style=\"background-color:transparent\">7. \u5728 cmd \u4e0a\u6253\u5f00 SDP \u7684log\u7528\u6765\u89c2\u5bdfSDP\u7684 \u5185\u5bb9<\/h2>\n<p>\u4f7f\u7528\u63a8\u6d41 \u548c \u62c9\u6d41\u7684 \u65b9\u5f0f\u6253\u5f00<\/p>\n<p>  ffmpeg -re -i &#034;zerenlian.mp4&#034; -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp:\/\/192.168.245.130\/test\/002zerenlianmp4 -loglevel 40<br \/>\n  \u00a0 <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"641\" src=\"2025-04-18xw4xlkaus51.png\" width=\"1200\" \/> <\/p>\n<p>  ffplay -rtsp_transport tcp rtsp:\/\/192.168.245.130\/test\/002zerenlianmp4 -loglevel 40 <\/p>\n<p> <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"661\" src=\"2025-04-18thpohrfaxvn.png\" width=\"1200\" \/> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e2\u6b21\uff0c\u6536\u85cf2\u6b21\u3002ZLMediaKit \u662f\u5565\uff1f\u5982\u4f55\u4f7f\u7528ZLMediaKit \u642d\u5efaRTSP \u670d\u52a1\u5668_zlmediakit<\/p>\n","protected":false},"author":2,"featured_media":11630,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55],"topic":[],"class_list":["post-11650","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528ZLMediaKit \u5f00\u6e90\u9879\u76ee\u642d\u5efaRTSP \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/11650.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528ZLMediaKit \u5f00\u6e90\u9879\u76ee\u642d\u5efaRTSP \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e2\u6b21\uff0c\u6536\u85cf2\u6b21\u3002ZLMediaKit \u662f\u5565\uff1f\u5982\u4f55\u4f7f\u7528ZLMediaKit \u642d\u5efaRTSP \u670d\u52a1\u5668_zlmediakit\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/11650.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T10:54:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105435-68022f6b93dd0.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/11650.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/11650.html\",\"name\":\"\u4f7f\u7528ZLMediaKit \u5f00\u6e90\u9879\u76ee\u642d\u5efaRTSP \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T10:54:43+00:00\",\"dateModified\":\"2025-04-18T10:54:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/11650.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/11650.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/11650.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528ZLMediaKit \u5f00\u6e90\u9879\u76ee\u642d\u5efaRTSP \u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528ZLMediaKit \u5f00\u6e90\u9879\u76ee\u642d\u5efaRTSP \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/11650.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528ZLMediaKit \u5f00\u6e90\u9879\u76ee\u642d\u5efaRTSP \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e2\u6b21\uff0c\u6536\u85cf2\u6b21\u3002ZLMediaKit \u662f\u5565\uff1f\u5982\u4f55\u4f7f\u7528ZLMediaKit \u642d\u5efaRTSP \u670d\u52a1\u5668_zlmediakit","og_url":"https:\/\/www.wsisp.com\/helps\/11650.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T10:54:43+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418105435-68022f6b93dd0.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/11650.html","url":"https:\/\/www.wsisp.com\/helps\/11650.html","name":"\u4f7f\u7528ZLMediaKit \u5f00\u6e90\u9879\u76ee\u642d\u5efaRTSP \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T10:54:43+00:00","dateModified":"2025-04-18T10:54:43+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/11650.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/11650.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/11650.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528ZLMediaKit \u5f00\u6e90\u9879\u76ee\u642d\u5efaRTSP \u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/11650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=11650"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/11650\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/11630"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=11650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=11650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=11650"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=11650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}