{"id":61525,"date":"2026-01-17T23:34:00","date_gmt":"2026-01-17T15:34:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/61525.html"},"modified":"2026-01-17T23:34:00","modified_gmt":"2026-01-17T15:34:00","slug":"%e9%9b%b6%e5%bb%b6%e8%bf%9f-rtsp-%e8%a7%86%e9%a2%91%e6%b5%81%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e5%ae%9e%e7%8e%b0%e7%bd%91%e7%bb%9c%e6%91%84%e5%83%8f%e5%a4%b4ai%e5%a4%84%e7%90%860%e5%bb%b6%e8%bf%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/61525.html","title":{"rendered":"\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u7f51\u7edc\u6444\u50cf\u5934AI\u5904\u74060\u5ef6\u8fdf"},"content":{"rendered":"<h2>\u3010\u5f00\u6e90\u3011\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668 &#8211; \u8ba9 AI \u68c0\u6d4b\u753b\u9762\u5b9e\u65f6\u5448\u73b0<\/h2>\n<p>\u96f6\u5ef6\u8fdf\u4e0d\u662f\u5962\u4f88\u54c1&#xff0c;\u800c\u662f\u89e6\u624b\u53ef\u53ca\u2014\u2014\u8ba9\u6bcf\u4e00\u5e27\u90fd\u5b9e\u65f6\u5448\u73b0\u3002&#x1f339; \u4f4e\u5ef6\u8fdf\u63a8\u6d41\u4e0d\u8be5\u88ab\u5546\u4e1aSDK\u7ed1\u67b6&#xff0c;\u800c\u662f\u5e94\u8be5\u5f00\u6e90\u5171\u4eab&#xff0c;\u8ba9\u66f4\u591a\u5f00\u53d1\u8005\u53d7\u76ca\u3002&#x1f339; \u575a\u4fe1\u4e92\u8054\u7f51\u672c\u5c31\u662f\u5206\u4eab\u7cbe\u795e &#x1f4aa;&#x1f4aa;&#x1f4aa;<\/p>\n<hr \/>\n<h3>&#x1f4cc; \u9879\u76ee\u5730\u5740<\/h3>\n<ul>\n<li>GitHub&#xff1a; https:\/\/github.com\/xiabie666\/rtsp_server<\/li>\n<li>Gitee&#xff1a; https:\/\/gitee.com\/xiabieyo\/rtsp-server<\/li>\n<\/ul>\n<h3>&#x1f4cc; \u6280\u672f\u6808<\/h3>\n<p>![\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0](https:\/\/i-blog.csdnimg.cn\/direct\/ebc8a91de2994620a4f3644cd64aad6b.gif#pic_center<\/p>\n<p>C&#043;&#043; &#043; Live555 &#043; FFmpeg &#043; OpenCV &#043; NVENC\u786c\u4ef6\u7f16\u7801 &#043; Python Pybind11<\/p>\n<h3>&#x1f4cc; \u529f\u80fd<\/h3>\n<p>\u96f6\u5ef6\u8fdfRTSP\u89c6\u9891\u6d41\u670d\u52a1\u5668&#xff0c;\u652f\u6301NVENC\u786c\u4ef6\u7f16\u7801&#xff08;&lt;5ms&#xff09;\u3001\u81ea\u52a8\u6ce8\u518cZLMediaKit\u5b9e\u73b0WebRTC\u64ad\u653e\u3001AI\u68c0\u6d4b\u7ed3\u679c\u5b9e\u65f6\u63a8\u6d41\u3001Python\u7ed1\u5b9a\u30014K\u5206\u8fa8\u7387 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260117153359-696babe78d1c6.gif\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h3>&#x1f4a1; \u9879\u76ee\u7531\u6765<\/h3>\n<p>\u505a AI \u5b89\u9632\u9879\u76ee\u65f6&#xff0c;\u6211\u9047\u5230\u4e86\u4e00\u4e2a\u8ba9\u4eba\u6293\u72c2\u7684\u95ee\u9898&#xff1a;AI \u68c0\u6d4b\u753b\u9762\u5ef6\u8fdf\u592a\u9ad8\u4e86&#xff01;<\/p>\n<p>\u4f20\u7edf\u65b9\u6848\u662f\u628a AI \u63a8\u7406\u540e\u7684\u89c6\u9891\u6d41\u4ee5 RTMP \u63a8\u9001\u7ed9 ZLMediaKit&#xff0c;\u518d\u8f6c WebRTC \u64ad\u653e\u3002\u4f46\u65e0\u8bba\u600e\u4e48\u8c03\u53c2\u6570&#xff0c;\u5ef6\u8fdf\u59cb\u7ec8\u5728 2-5 \u79d2\u5f98\u5f8a\u3002\u4eba\u90fd\u8d70\u51fa\u753b\u9762\u4e86&#xff0c;\u62a5\u8b66\u624d\u59d7\u59d7\u6765\u8fdf&#xff0c;\u8fd9\u5728\u5b89\u9632\u573a\u666f\u7b80\u76f4\u662f\u707e\u96be\u3002<\/p>\n<p>\u76f4\u5230\u6709\u4e00\u5929&#xff0c;\u6211\u7a81\u7136\u60f3\u5230&#xff1a;ZLMediaKit \u5929\u751f\u652f\u6301 WebRTC&#xff0c;\u800c\u4e14\u6211\u4e4b\u524d\u7528 RTSP \u8fde\u63a5\u6444\u50cf\u5934\u65f6&#xff0c;ZLM \u7684 WebRTC \u64ad\u653e\u662f\u5b9e\u65f6\u7684&#xff01;<\/p>\n<p>\u90a3\u4e48\u95ee\u9898\u6765\u4e86&#xff1a;\u5982\u679c\u6211\u628a AI \u63a8\u7406\u540e\u7684\u89c6\u9891\u6d41\u4e5f\u5c01\u88c5\u6210 RTSP \u6d41&#xff0c;\u8ba9 ZLM \u4ee5\u62c9\u6d41\u7684\u65b9\u5f0f\u6765\u83b7\u53d6&#xff0c;\u662f\u4e0d\u662f\u5c31\u80fd\u5b9e\u73b0\u8fd1\u4e4e\u96f6\u5ef6\u8fdf&#xff1f;<\/p>\n<p>\u8bf4\u5e72\u5c31\u5e72&#xff01;\u6211\u57fa\u4e8e live555 \u7f16\u5199\u4e86\u8fd9\u4e2a RTSP \u670d\u52a1\u5668&#xff0c;\u914d\u5408 NVENC \u786c\u4ef6\u7f16\u7801&#xff0c;\u6700\u7ec8\u5b9e\u73b0\u4e86 50-100ms \u7684\u7aef\u5230\u7aef\u5ef6\u8fdf\u3002<\/p>\n<p>\u4ece 2-5 \u79d2\u5230 50-100ms&#xff0c;\u8fd9\u4e0d\u662f\u4f18\u5316&#xff0c;\u8fd9\u662f\u8d28\u53d8&#xff01;<\/p>\n<hr \/>\n<h3>&#x1f3af; \u4e3a\u4ec0\u4e48\u9700\u8981\u5b83&#xff1f;<\/h3>\n<p>\u4f60\u662f\u5426\u9047\u5230\u8fc7\u8fd9\u4e9b\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>&#x1f624; AI \u68c0\u6d4b\u753b\u9762\u5ef6\u8fdf 3-5 \u79d2&#xff0c;\u4eba\u90fd\u8d70\u51fa\u753b\u9762\u4e86\u624d\u62a5\u8b66<\/li>\n<li>&#x1f624; RTMP \u63a8\u6d41\u5361\u987f&#xff0c;WebRTC \u64ad\u653e\u4f53\u9a8c\u6781\u5dee<\/li>\n<li>&#x1f624; \u60f3\u8981\u5b9e\u65f6\u9884\u89c8 AI \u63a8\u7406\u7ed3\u679c&#xff0c;\u5374\u603b\u662f\u6162\u534a\u62cd<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u9879\u76ee\u5c31\u662f\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e9b\u75db\u70b9&#xff01;<\/p>\n<h4>\u26a1 \u5ef6\u8fdf\u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u65b9\u6848\u5ef6\u8fdf\u4f53\u9a8c<\/tr>\n<tbody>\n<tr>\n<td>\u4f20\u7edf RTMP \u63a8\u6d41<\/td>\n<td>2-5 \u79d2<\/td>\n<td>&#x1f62b; \u4eba\u90fd\u8d70\u4e86\u624d\u770b\u5230<\/td>\n<\/tr>\n<tr>\n<td>\u672c\u65b9\u6848 RTSP Server<\/td>\n<td>50-100ms<\/td>\n<td>&#x1f680; \u51e0\u4e4e\u5b9e\u65f6\u540c\u6b65&#xff01;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4f20\u7edf\u65b9\u6848&#xff1a;AI\u7a0b\u5e8f \u2192 RTMP\u63a8\u6d41 \u2192 ZLM \u2192 WebRTC     \u5ef6\u8fdf 2-5\u79d2  \u274c<br \/>\n\u672c\u65b9\u6848&#xff1a;  AI\u7a0b\u5e8f \u2192 RTSP\u670d\u52a1\u5668 \u2192 ZLM\u62c9\u6d41 \u2192 WebRTC  \u5ef6\u8fdf 50-100ms \u2705<\/p>\n<hr \/>\n<h3>\u2728 \u7279\u6027\u4e00\u89c8<\/h3>\n<table>\n<tr>\u7279\u6027\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>&#x1f3ae; NVENC \u786c\u4ef6\u7f16\u7801<\/td>\n<td>NVIDIA GPU \u52a0\u901f&#xff0c;\u7f16\u7801\u5ef6\u8fdf &lt;5ms<\/td>\n<\/tr>\n<tr>\n<td>\u26a1 \u6781\u81f4\u4f4e\u5ef6\u8fdf<\/td>\n<td>\u5355\u5e27\u7f13\u51b2&#xff0c;\u6765\u4e00\u5e27\u7f16\u4e00\u5e27<\/td>\n<\/tr>\n<tr>\n<td>&#x1f517; ZLM \u81ea\u52a8\u6ce8\u518c<\/td>\n<td>\u542f\u52a8\u5373\u53ef WebRTC \u64ad\u653e&#xff0c;\u65e0\u9700\u624b\u52a8\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>&#x1f4f9; \u591a\u6444\u50cf\u5934\u652f\u6301<\/td>\n<td>\u6bcf\u8def\u89c6\u9891\u72ec\u7acb\u5b9e\u4f8b&#xff0c;\u8f7b\u677e\u6269\u5c55<\/td>\n<\/tr>\n<tr>\n<td>&#x1f40d; \u591a\u8bed\u8a00\u652f\u6301<\/td>\n<td>C&#043;&#043; \u5e93 &#043; Python \u7ed1\u5b9a&#xff0c;\u968f\u4f60\u9009\u62e9<\/td>\n<\/tr>\n<tr>\n<td>&#x1f504; \u65ad\u7ebf\u91cd\u8fde<\/td>\n<td>\u7f51\u7edc\u6296\u52a8&#xff1f;\u81ea\u52a8\u6062\u590d&#xff01;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>&#x1f3d7;\ufe0f \u67b6\u6784<\/h3>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502   \u6444\u50cf\u5934\/\u89c6\u9891    \u2502\u2500\u2500\u2500\u2500&gt;\u2502    AI \u63a8\u7406\u7a0b\u5e8f    \u2502\u2500\u2500\u2500\u2500&gt;\u2502   RTSP Server   \u2502\u2500\u2500\u2500\u2500&gt;\u2502   ZLMediaKit    \u2502<br \/>\n\u2502                 \u2502     \u2502   (\u68c0\u6d4b&#043;\u753b\u6846)     \u2502     \u2502  (NVENC\u7f16\u7801)    \u2502     \u2502  (WebRTC\u8f6c\u53d1)   \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<h4>\u4e3a\u4ec0\u4e48\u5ef6\u8fdf\u66f4\u4f4e&#xff1f;<\/h4>\n<table>\n<tr>\u5bf9\u6bd4\u9879RTSP \u670d\u52a1\u5668\u6a21\u5f0fRTMP \u63a8\u6d41\u6a21\u5f0f<\/tr>\n<tbody>\n<tr>\n<td>\u6570\u636e\u6d41\u5411<\/td>\n<td>ZLM \u4e3b\u52a8\u62c9\u53d6<\/td>\n<td>AI\u7a0b\u5e8f \u4e3b\u52a8\u63a8\u9001<\/td>\n<\/tr>\n<tr>\n<td>\u7f13\u51b2\u7b56\u7565<\/td>\n<td>\u5355\u5e27\u7f13\u51b2<\/td>\n<td>\u591a\u5e27\u7f13\u51b2<\/td>\n<\/tr>\n<tr>\n<td>\u7f16\u7801\u6a21\u5f0f<\/td>\n<td>NVENC \u96f6\u5ef6\u8fdf<\/td>\n<td>\u6807\u51c6\u7f16\u7801<\/td>\n<\/tr>\n<tr>\n<td>\u7aef\u5230\u7aef\u5ef6\u8fdf<\/td>\n<td>50-100ms \u2705<\/td>\n<td>2-5\u79d2 \u274c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>&#x1f680; \u5feb\u901f\u5f00\u59cb<\/h3>\n<h4>1. \u7f16\u8bd1<\/h4>\n<p>cd rtsp_server<br \/>\nbuild.bat<\/p>\n<h4>2. \u8fd0\u884c<\/h4>\n<p>RTSPServer.exe rtsp:\/\/admin:password&#064;192.168.1.64:554\/stream &#8211;zlm-secret \u4f60\u7684\u5bc6\u94a5<\/p>\n<h4>3. \u64ad\u653e<\/h4>\n<p>http:\/\/localhost:8088\/index\/api\/webrtc?app&#061;live&#038;stream&#061;ai_stream<\/p>\n<hr \/>\n<h3>&#x1f527; \u96c6\u6210\u5230\u4f60\u7684 AI \u9879\u76ee<\/h3>\n<h4>C&#043;&#043; \u96c6\u6210<\/h4>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&#034;RTSPServer.h&#034;<\/span><\/span><\/p>\n<p>RTSPServerWrapper server<span class=\"token punctuation\">;<\/span><br \/>\nserver<span class=\"token punctuation\">.<\/span><span class=\"token function\">init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">8554<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;ai_stream&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">704<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">576<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\nserver<span class=\"token punctuation\">.<\/span><span class=\"token function\">start<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span>running<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    cv<span class=\"token double-colon punctuation\">::<\/span>Mat frame <span class=\"token operator\">&#061;<\/span> camera<span class=\"token punctuation\">.<\/span><span class=\"token function\">read<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">auto<\/span> results <span class=\"token operator\">&#061;<\/span> yolo<span class=\"token punctuation\">.<\/span><span class=\"token function\">detect<\/span><span class=\"token punctuation\">(<\/span>frame<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">drawBoxes<\/span><span class=\"token punctuation\">(<\/span>frame<span class=\"token punctuation\">,<\/span> results<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    server<span class=\"token punctuation\">.<\/span><span class=\"token function\">pushFrame<\/span><span class=\"token punctuation\">(<\/span>frame<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u5c31\u8fd9\u4e00\u884c&#xff01;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>server<span class=\"token punctuation\">.<\/span><span class=\"token function\">stop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h4>Python \u96c6\u6210<\/h4>\n<p><span class=\"token keyword\">import<\/span> rtsp_server<\/p>\n<p>server <span class=\"token operator\">&#061;<\/span> rtsp_server<span class=\"token punctuation\">.<\/span>RTSPServer<span class=\"token punctuation\">(<\/span><span class=\"token number\">8554<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;ai_stream&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">704<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">576<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span><br \/>\nserver<span class=\"token punctuation\">.<\/span>start<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">while<\/span> <span class=\"token boolean\">True<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    frame <span class=\"token operator\">&#061;<\/span> cap<span class=\"token punctuation\">.<\/span>read<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    results <span class=\"token operator\">&#061;<\/span> yolo<span class=\"token punctuation\">.<\/span>detect<span class=\"token punctuation\">(<\/span>frame<span class=\"token punctuation\">)<\/span><br \/>\n    frame <span class=\"token operator\">&#061;<\/span> draw_boxes<span class=\"token punctuation\">(<\/span>frame<span class=\"token punctuation\">,<\/span> results<span class=\"token punctuation\">)<\/span><\/p>\n<p>    server<span class=\"token punctuation\">.<\/span>push_frame<span class=\"token punctuation\">(<\/span>frame<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u5c31\u8fd9\u4e00\u884c&#xff01;<\/span><\/p>\n<p>server<span class=\"token punctuation\">.<\/span>stop<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<hr \/>\n<h3>&#x1f4f9; \u591a\u6444\u50cf\u5934\u652f\u6301<\/h3>\n<p>\u6bcf\u4e2a\u6444\u50cf\u5934\u521b\u5efa\u72ec\u7acb\u7684 RTSP Server \u5b9e\u4f8b&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ \u65b9\u5f0f1&#xff1a;\u4e0d\u540c\u7aef\u53e3<\/span><br \/>\nRTSPServerWrapper server1<span class=\"token punctuation\">,<\/span> server2<span class=\"token punctuation\">;<\/span><br \/>\nserver1<span class=\"token punctuation\">.<\/span><span class=\"token function\">init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">8554<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;camera1&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">704<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">576<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ rtsp:\/\/localhost:8554\/camera1<\/span><br \/>\nserver2<span class=\"token punctuation\">.<\/span><span class=\"token function\">init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">8555<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;camera2&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">704<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">576<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ rtsp:\/\/localhost:8555\/camera2<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u65b9\u5f0f2&#xff1a;\u540c\u7aef\u53e3\u4e0d\u540c\u6d41\u540d&#xff08;\u63a8\u8350&#xff09;<\/span><br \/>\nserver1<span class=\"token punctuation\">.<\/span><span class=\"token function\">init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">8554<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;camera1&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">704<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">576<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ rtsp:\/\/localhost:8554\/camera1<\/span><br \/>\nserver2<span class=\"token punctuation\">.<\/span><span class=\"token function\">init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">8554<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;camera2&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">704<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">576<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ rtsp:\/\/localhost:8554\/camera2<\/span><\/p>\n<hr \/>\n<h3>\u26a1 \u6027\u80fd\u6307\u6807<\/h3>\n<table>\n<tr>\u6307\u6807\u6570\u503c<\/tr>\n<tbody>\n<tr>\n<td>\u7f16\u7801\u5ef6\u8fdf<\/td>\n<td>&lt;5ms (NVENC)<\/td>\n<\/tr>\n<tr>\n<td>\u7aef\u5230\u7aef\u5ef6\u8fdf<\/td>\n<td>50-100ms<\/td>\n<\/tr>\n<tr>\n<td>\u652f\u6301\u5206\u8fa8\u7387<\/td>\n<td>\u6700\u9ad8 4K<\/td>\n<\/tr>\n<tr>\n<td>\u9ed8\u8ba4\u7801\u7387<\/td>\n<td>4Mbps<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>&#x1f4cb; \u7cfb\u7edf\u8981\u6c42<\/h3>\n<ul>\n<li>Windows 10\/11<\/li>\n<li>Visual Studio 2022<\/li>\n<li>CMake 3.15&#043;<\/li>\n<li>vcpkg: opencv4, glog, ffmpeg<\/li>\n<li>NVIDIA GPU (\u53ef\u9009&#xff0c;\u7528\u4e8e NVENC \u786c\u4ef6\u7f16\u7801)<\/li>\n<li>ZLMediaKit (\u7528\u4e8e WebRTC \u8f6c\u53d1)<\/li>\n<\/ul>\n<hr \/>\n<h3>&#x1f41b; \u5e38\u89c1\u95ee\u9898<\/h3>\n<h4>ZLM \u62c9\u6d41\u5931\u8d25<\/h4>\n<li>\u786e\u4fdd ZLMediaKit \u5df2\u542f\u52a8<\/li>\n<li>\u68c0\u67e5 RTSP Server \u662f\u5426\u6b63\u5e38\u8fd0\u884c<\/li>\n<li>\u7528 VLC \u6d4b\u8bd5&#xff1a;vlc rtsp:\/\/localhost:8554\/ai_stream<\/li>\n<h4>NVENC \u4e0d\u53ef\u7528<\/h4>\n<p>\u7a0b\u5e8f\u4f1a\u81ea\u52a8\u5207\u6362\u5230 x264 \u8f6f\u4ef6\u7f16\u7801&#xff0c;\u5ef6\u8fdf\u4f1a\u7a0d\u9ad8\u4f46\u4ecd\u53ef\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n<h4>\u753b\u9762\u5361\u987f<\/h4>\n<li>\u68c0\u67e5\u6444\u50cf\u5934\u7f51\u7edc\u662f\u5426\u7a33\u5b9a<\/li>\n<li>\u964d\u4f4e\u5206\u8fa8\u7387\u6216\u5e27\u7387<\/li>\n<li>\u786e\u4fdd GPU \u6ca1\u6709\u88ab\u5176\u4ed6\u7a0b\u5e8f\u5360\u6ee1<\/li>\n<hr \/>\n<h3>&#x1f64f; \u81f4\u8c22<\/h3>\n<ul>\n<li>ZLMediaKit &#8211; \u590f\u695a\u5927\u4f6c\u5f00\u6e90\u7684\u6d41\u5a92\u4f53\u670d\u52a1\u5668<\/li>\n<li>live555 &#8211; \u7ecf\u5178\u7684 RTSP\/RTP \u5f00\u6e90\u5e93<\/li>\n<li>FFmpeg &#8211; \u5f3a\u5927\u7684\u97f3\u89c6\u9891\u5904\u7406\u5e93<\/li>\n<\/ul>\n<hr \/>\n<h3>&#x1f468;\u200d&#x1f4bb; \u4f5c\u8005<\/h3>\n<p>\u590f\u522b &#8211; \u4e00\u4e2a\u70ed\u7231\u6298\u817e\u7684\u5f00\u53d1\u8005<\/p>\n<p>\u5982\u679c\u8fd9\u4e2a\u9879\u76ee\u5bf9\u4f60\u6709\u5e2e\u52a9&#xff0c;\u6b22\u8fce Star \u2b50 \u548c Fork&#xff01;<\/p>\n<p>\u6709\u95ee\u9898\u6216\u5efa\u8bae&#xff1f;\u6b22\u8fce\u63d0 Issue&#xff01;<\/p>\n<hr \/>\n<p>\u2b50 \u5982\u679c\u6709\u5e2e\u52a9&#xff0c;\u8bf7 Star&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u5f00\u6e90\u3011\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668 &#8211; \u8ba9 AI \u68c0\u6d4b\u753b\u9762\u5b9e\u65f6\u5448\u73b0 \u96f6\u5ef6\u8fdf\u4e0d\u662f\u5962\u4f88\u54c1&#xff0c;\u800c\u662f\u89e6\u624b\u53ef\u53ca\u2014\u2014\u8ba9\u6bcf\u4e00\u5e27\u90fd\u5b9e\u65f6\u5448\u73b0\u3002&#x1f339; \u4f4e\u5ef6\u8fdf\u63a8\u6d41\u4e0d\u8be5\u88ab\u5546\u4e1aSDK\u7ed1\u67b6&#xff0c;\u800c\u662f\u5e94\u8be5\u5f00\u6e90\u5171\u4eab&#xff0c;\u8ba9\u66f4\u591a\u5f00\u53d1\u8005\u53d7\u76ca\u3002&#x1f339; \u575a\u4fe1\u4e92\u8054\u7f51\u672c\u5c31\u662f\u5206\u4eab\u7cbe\u795e &#x1f4aa;&#x1f4aa;&#x1f4aa; &#x1f4cc; \u9879\u76ee\u5730\u5740<br \/>\nGitHub&#xff1a; https:\/\/github.com\/xiabie666\/r<\/p>\n","protected":false},"author":2,"featured_media":61524,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[213,156,50,801,62,214],"topic":[],"class_list":["post-61525","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-ffmpeg","tag-yolo","tag-50","tag-801","tag-62","tag-214"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u7f51\u7edc\u6444\u50cf\u5934AI\u5904\u74060\u5ef6\u8fdf - \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\/61525.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u7f51\u7edc\u6444\u50cf\u5934AI\u5904\u74060\u5ef6\u8fdf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u3010\u5f00\u6e90\u3011\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668 - \u8ba9 AI \u68c0\u6d4b\u753b\u9762\u5b9e\u65f6\u5448\u73b0 \u96f6\u5ef6\u8fdf\u4e0d\u662f\u5962\u4f88\u54c1&#xff0c;\u800c\u662f\u89e6\u624b\u53ef\u53ca\u2014\u2014\u8ba9\u6bcf\u4e00\u5e27\u90fd\u5b9e\u65f6\u5448\u73b0\u3002&#x1f339; \u4f4e\u5ef6\u8fdf\u63a8\u6d41\u4e0d\u8be5\u88ab\u5546\u4e1aSDK\u7ed1\u67b6&#xff0c;\u800c\u662f\u5e94\u8be5\u5f00\u6e90\u5171\u4eab&#xff0c;\u8ba9\u66f4\u591a\u5f00\u53d1\u8005\u53d7\u76ca\u3002&#x1f339; \u575a\u4fe1\u4e92\u8054\u7f51\u672c\u5c31\u662f\u5206\u4eab\u7cbe\u795e &#x1f4aa;&#x1f4aa;&#x1f4aa; &#x1f4cc; \u9879\u76ee\u5730\u5740 GitHub&#xff1a; https:\/\/github.com\/xiabie666\/r\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/61525.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-17T15:34:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260117153359-696babe78d1c6.gif\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/61525.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/61525.html\",\"name\":\"\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u7f51\u7edc\u6444\u50cf\u5934AI\u5904\u74060\u5ef6\u8fdf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-17T15:34:00+00:00\",\"dateModified\":\"2026-01-17T15:34:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/61525.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/61525.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/61525.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u7f51\u7edc\u6444\u50cf\u5934AI\u5904\u74060\u5ef6\u8fdf\"}]},{\"@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":"\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u7f51\u7edc\u6444\u50cf\u5934AI\u5904\u74060\u5ef6\u8fdf - \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\/61525.html","og_locale":"zh_CN","og_type":"article","og_title":"\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u7f51\u7edc\u6444\u50cf\u5934AI\u5904\u74060\u5ef6\u8fdf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u3010\u5f00\u6e90\u3011\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668 - \u8ba9 AI \u68c0\u6d4b\u753b\u9762\u5b9e\u65f6\u5448\u73b0 \u96f6\u5ef6\u8fdf\u4e0d\u662f\u5962\u4f88\u54c1&#xff0c;\u800c\u662f\u89e6\u624b\u53ef\u53ca\u2014\u2014\u8ba9\u6bcf\u4e00\u5e27\u90fd\u5b9e\u65f6\u5448\u73b0\u3002&#x1f339; \u4f4e\u5ef6\u8fdf\u63a8\u6d41\u4e0d\u8be5\u88ab\u5546\u4e1aSDK\u7ed1\u67b6&#xff0c;\u800c\u662f\u5e94\u8be5\u5f00\u6e90\u5171\u4eab&#xff0c;\u8ba9\u66f4\u591a\u5f00\u53d1\u8005\u53d7\u76ca\u3002&#x1f339; \u575a\u4fe1\u4e92\u8054\u7f51\u672c\u5c31\u662f\u5206\u4eab\u7cbe\u795e &#x1f4aa;&#x1f4aa;&#x1f4aa; &#x1f4cc; \u9879\u76ee\u5730\u5740 GitHub&#xff1a; https:\/\/github.com\/xiabie666\/r","og_url":"https:\/\/www.wsisp.com\/helps\/61525.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-17T15:34:00+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260117153359-696babe78d1c6.gif"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/61525.html","url":"https:\/\/www.wsisp.com\/helps\/61525.html","name":"\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u7f51\u7edc\u6444\u50cf\u5934AI\u5904\u74060\u5ef6\u8fdf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-17T15:34:00+00:00","dateModified":"2026-01-17T15:34:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/61525.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/61525.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/61525.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u96f6\u5ef6\u8fdf RTSP \u89c6\u9891\u6d41\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u7f51\u7edc\u6444\u50cf\u5934AI\u5904\u74060\u5ef6\u8fdf"}]},{"@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\/61525","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=61525"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/61525\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/61524"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=61525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=61525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=61525"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=61525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}