{"id":17758,"date":"2025-04-19T00:18:04","date_gmt":"2025-04-18T16:18:04","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/17758.html"},"modified":"2025-04-19T00:18:04","modified_gmt":"2025-04-18T16:18:04","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8android%e4%b8%8a%e5%ae%9e%e7%8e%b0rtsp%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/17758.html","title":{"rendered":"\u5982\u4f55\u5728Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668"},"content":{"rendered":"<h3>\u6280\u672f\u80cc\u666f<\/h3>\n<p>\u5728Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668\u786e\u5b9e\u662f\u4e00\u4e2a\u4e0d\u592a\u5e38\u89c1\u7684\u9700\u6c42&#xff0c;\u56e0\u4e3aAndroid\u5e73\u53f0\u4e3b\u8981\u662f\u4e3a\u5ba2\u6237\u7aef\u5e94\u7528\u8bbe\u8ba1\u7684\u3002\u5728\u4e00\u4e9b\u5185\u7f51\u573a\u666f\u4e0b&#xff0c;\u6211\u4eec\u66f4\u5e0c\u671b\u628a\u5b89\u5353\u7ec8\u7aef\u6216\u5f00\u53d1\u677f&#xff0c;\u4f5c\u4e3a\u4e00\u4e2aIPC&#xff08;\u7f51\u7edc\u6444\u50cf\u673a&#xff09;\u4e00\u6837&#xff0c;\u5bf9\u5916\u63d0\u4f9b\u4e2a\u62c9\u6d41\u7684rtsp url&#xff0c;\u7136\u540e\u628a\u6444\u50cf\u5934\u9ea6\u514b\u98ce\u751a\u81f3\u5c4f\u5e55\u91c7\u96c6\u7684\u6570\u636e&#xff0c;\u5171\u4eab\u51fa\u53bb&#xff0c;\u8f7b\u91cf\u7ea7RTSP\u7684\u8bbe\u8ba1\u7406\u5ff5\u8131\u9896\u800c\u51fa\u3002<\/p>\n<p>\u8f7b\u91cf\u7ea7RTSP\u670d\u52a1\u8bbe\u8ba1\u521d\u8877&#xff0c;\u5c31\u662f\u907f\u514d\u7528\u6237\u5355\u72ec\u90e8\u7f72RTSP\u6216\u8005RTMP\u670d\u52a1&#xff0c;\u5b9e\u73b0\u672c\u5730\u7684\u97f3\u89c6\u9891\u6570\u636e&#xff08;\u5982\u6444\u50cf\u5934\u3001\u9ea6\u514b\u98ce&#xff09;&#xff0c;\u7f16\u7801\u540e&#xff0c;\u6c47\u805a\u5230\u5185\u7f6eRTSP\u670d\u52a1&#xff0c;\u5bf9\u5916\u63d0\u4f9b\u53ef\u4f9b\u62c9\u6d41\u7684RTSP URL&#xff0c;\u8f7b\u91cf\u7ea7RTSP\u670d\u52a1&#xff0c;\u9002\u7528\u4e8e\u5185\u7f51\u73af\u5883\u4e0b&#xff0c;\u5bf9\u5e76\u53d1\u8981\u6c42\u4e0d\u9ad8\u7684\u573a\u666f&#xff0c;\u652f\u6301H.264\/H.265&#xff0c;\u652f\u6301RTSP\u9274\u6743\u3001\u5355\u64ad\u3001\u7ec4\u64ad\u6a21\u5f0f&#xff0c;\u8003\u8651\u5230\u5355\u4e2a\u670d\u52a1\u627f\u8f7d\u80fd\u529b&#xff0c;\u6211\u4eec\u652f\u6301\u540c\u65f6\u521b\u5efa\u591a\u4e2aRTSP\u670d\u52a1&#xff0c;\u5e76\u652f\u6301\u83b7\u53d6\u5f53\u524dRTSP\u670d\u52a1\u4f1a\u8bdd\u8fde\u63a5\u6570\u3002<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418161802-68027b3a14c91.png\" \/><\/p>\n<h3>\u5982\u4f55\u5b9e\u73b0RTSP\u670d\u52a1\u5668<\/h3>\n<p id=\"\">\u5982\u679c\u4f60\u627e\u4e0d\u5230\u5408\u9002\u7684\u5e93&#xff0c;\u6216\u8005\u9700\u8981\u66f4\u9ad8\u7ea7\u7684\u529f\u80fd&#xff0c;\u4f60\u53ef\u4ee5\u8003\u8651\u7f16\u5199\u81ea\u5df1\u7684RTSP\u670d\u52a1\u5668&#xff1a;<\/p>\n<ul>\n<li>\u4e86\u89e3RTSP\u534f\u8bae&#xff1a;\u9996\u5148&#xff0c;\u4f60\u9700\u8981\u6df1\u5165\u4e86\u89e3RTSP\u534f\u8bae\u7684\u5de5\u4f5c\u539f\u7406&#xff0c;\u5305\u62ec\u5176\u6d88\u606f\u683c\u5f0f\u3001\u4f1a\u8bdd\u7ba1\u7406\u548c\u6d41\u63a7\u5236\u673a\u5236\u3002<\/li>\n<li>\u7f51\u7edc\u7f16\u7a0b&#xff1a;\u5728Android\u4e0a&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528Java\u7684Socket API\u6765\u5904\u7406\u7f51\u7edc\u901a\u4fe1&#xff0c;\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5e95\u5c42\u5b9e\u73b0&#xff0c;\u7136\u540e\u5bf9\u4e0a\u63d0\u4f9bjni\u7684\u63a5\u53e3\u3002\u4f60\u9700\u8981\u7f16\u5199\u4ee3\u7801\u6765\u76d1\u542c\u7aef\u53e3\u3001\u63a5\u6536RTSP\u8bf7\u6c42\u3001\u89e3\u6790\u8bf7\u6c42\u5e76\u53d1\u9001\u54cd\u5e94\u3002<\/li>\n<li>\u5a92\u4f53\u5904\u7406&#xff1a;RTSP\u670d\u52a1\u5668\u9700\u8981\u80fd\u591f\u6355\u83b7\u3001\u7f16\u7801\u548c\u4f20\u8f93\u5a92\u4f53\u6570\u636e\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528Android\u7684Camera\u6216Camera2\u7684API\u6765\u6355\u83b7\u89c6\u9891&#xff0c;\u5e76\u4f7f\u7528FFmpeg\u6216Android\u7684MediaCodec API\u6765\u5b9e\u73b0\u97f3\u89c6\u9891\u6570\u636e\u7f16\u7801\u3002<\/li>\n<li>\u591a\u7ebf\u7a0b\u548c\u5e76\u53d1&#xff1a;RTSP\u670d\u52a1\u5668\u9700\u8981\u5904\u7406\u591a\u4e2a\u5e76\u53d1\u5ba2\u6237\u7aef\u8fde\u63a5\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528Java\u7684\u7ebf\u7a0b\u6216\u5e76\u53d1API\u6765\u7ba1\u7406\u8fd9\u4e9b\u8fde\u63a5\u3002<\/li>\n<\/ul>\n<h4>\u529f\u80fd\u8bbe\u8ba1<\/h4>\n<p>\u4e00\u4e2a\u5b8c\u6574\u7684RTSP\u670d\u52a1&#xff0c;\u9700\u8981\u8bbe\u8ba1\u7684\u529f\u80fd\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li>\u00a0\u200b[\u89c6\u9891\u683c\u5f0f]H.264\/H.265(Android H.265\u786c\u7f16\u7801)&#xff1b;<\/li>\n<li>\u00a0[\u97f3\u9891\u683c\u5f0f]G.711 A\u5f8b\u3001AAC&#xff1b;<\/li>\n<li>\u534f\u8bae&#xff1a;RTSP&#xff1b;<\/li>\n<li>\u00a0[\u97f3\u91cf\u8c03\u8282]Android\u5e73\u53f0\u91c7\u96c6\u7aef\u652f\u6301\u5b9e\u65f6\u97f3\u91cf\u8c03\u8282&#xff1b;<\/li>\n<li>\u00a0[H.264\u786c\u7f16\u7801]\u652f\u6301H.264\u7279\u5b9a\u673a\u578b\u786c\u7f16\u7801&#xff1b;<\/li>\n<li>\u00a0[H.265\u786c\u7f16\u7801]\u652f\u6301H.265\u7279\u5b9a\u673a\u578b\u786c\u7f16\u7801&#xff1b;<\/li>\n<li>[\u97f3\u89c6\u9891]\u652f\u6301\u7eaf\u97f3\u9891\/\u7eaf\u89c6\u9891\/\u97f3\u89c6\u9891&#xff1b;<\/li>\n<li>[\u6444\u50cf\u5934]\u652f\u6301\u91c7\u96c6\u8fc7\u7a0b\u4e2d&#xff0c;\u524d\u540e\u6444\u50cf\u5934\u5b9e\u65f6\u5207\u6362&#xff1b;<\/li>\n<li>\u652f\u6301\u5e27\u7387\u3001\u5173\u952e\u5e27\u95f4\u9694(GOP)\u3001\u7801\u7387(bit-rate)\u8bbe\u7f6e&#xff1b;<\/li>\n<li>[\u5b9e\u65f6\u6c34\u5370]\u652f\u6301\u52a8\u6001\u6587\u5b57\u6c34\u5370\u3001png\u6c34\u5370&#xff1b;<\/li>\n<li>[\u5b9e\u65f6\u5feb\u7167]\u652f\u6301\u5b9e\u65f6\u5feb\u7167&#xff1b;<\/li>\n<li>[\u964d\u566a]\u652f\u6301\u73af\u5883\u97f3\u3001\u624b\u673a\u5e72\u6270\u7b49\u5f15\u8d77\u7684\u566a\u97f3\u964d\u566a\u5904\u7406\u3001\u81ea\u52a8\u589e\u76ca\u3001VAD\u68c0\u6d4b&#xff1b;<\/li>\n<li>[\u5916\u90e8\u7f16\u7801\u524d\u89c6\u9891\u6570\u636e\u5bf9\u63a5]\u652f\u6301YUV\u6570\u636e\u5bf9\u63a5&#xff1b;<\/li>\n<li>[\u5916\u90e8\u7f16\u7801\u524d\u97f3\u9891\u6570\u636e\u5bf9\u63a5]\u652f\u6301PCM\u5bf9\u63a5&#xff1b;<\/li>\n<li>[\u5916\u90e8\u7f16\u7801\u540e\u89c6\u9891\u6570\u636e\u5bf9\u63a5]\u652f\u6301\u5916\u90e8H.264\u3001H.265\u6570\u636e\u5bf9\u63a5&#xff1b;<\/li>\n<li>[\u5916\u90e8\u7f16\u7801\u540e\u97f3\u9891\u6570\u636e\u5bf9\u63a5]\u5916\u90e8AAC\u6570\u636e\u5bf9\u63a5&#xff1b;<\/li>\n<li>[\u6269\u5c55\u5f55\u50cf\u529f\u80fd]\u652f\u6301\u548c\u5f55\u50cfSDK\u7ec4\u5408\u4f7f\u7528&#xff0c;\u5f55\u50cf\u76f8\u5173\u529f\u80fd\u3002\u200b<\/li>\n<li>\u652f\u6301RTSP\u7aef\u53e3\u8bbe\u7f6e&#xff1b;<\/li>\n<li>\u652f\u6301RTSP\u9274\u6743\u7528\u6237\u540d\u3001\u5bc6\u7801\u8bbe\u7f6e&#xff1b;<\/li>\n<li>\u652f\u6301\u83b7\u53d6\u5f53\u524dRTSP\u670d\u52a1\u4f1a\u8bdd\u8fde\u63a5\u6570&#xff1b;<\/li>\n<li>\u652f\u6301Android\u00a05.1\u53ca\u4ee5\u4e0a\u7248\u672c\u3002<\/li>\n<\/ul>\n<h4>\u63a5\u53e3\u8bbe\u8ba1<\/h4>\n<table border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td colspan=\"3\">\n<p>Android\u5185\u7f6e\u8f7b\u91cf\u7ea7RTSP\u670d\u52a1SDK\u63a5\u53e3\u8be6\u89e3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u8c03\u7528\u63cf\u8ff0<\/p>\n<\/td>\n<td>\n<p>\u63a5\u53e3<\/p>\n<\/td>\n<td>\n<p>\u63a5\u53e3\u63cf\u8ff0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">\n<p>SmartRTSPServerSDK<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u521d\u59cb\u5316RTSP Server<\/p>\n<\/td>\n<td>\n<p>InitRtspServer<\/p>\n<\/td>\n<td>\n<p>Init rtsp server(\u548cUnInitRtspServer\u914d\u5bf9\u4f7f\u7528&#xff0c;\u5373\u4fbf\u662f\u542f\u52a8\u591a\u4e2aRTSP\u670d\u52a1&#xff0c;\u4e5f\u53ea\u9700\u8c03\u7528\u4e00\u6b21InitRtspServer&#xff0c;\u8bf7\u786e\u4fdd\u5728OpenRtspServer\u4e4b\u524d\u8c03\u7528)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u521b\u5efa\u4e00\u4e2artsp server<\/p>\n<\/td>\n<td>\n<p>OpenRtspServer<\/p>\n<\/td>\n<td>\n<p>\u521b\u5efa\u4e00\u4e2artsp server&#xff0c;\u8fd4\u56dertsp server\u53e5\u67c4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u8bbe\u7f6e\u7aef\u53e3<\/p>\n<\/td>\n<td>\n<p>SetRtspServerPort<\/p>\n<\/td>\n<td>\n<p>\u8bbe\u7f6ertsp server \u76d1\u542c\u7aef\u53e3, \u5728StartRtspServer\u4e4b\u524d\u5fc5\u987b\u8981\u8bbe\u7f6e\u7aef\u53e3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u8bbe\u7f6e\u9274\u6743\u7528\u6237\u540d\u3001\u5bc6\u7801<\/p>\n<\/td>\n<td>\n<p>SetRtspServerUserNamePassword<\/p>\n<\/td>\n<td>\n<p>\u8bbe\u7f6ertsp server \u9274\u6743\u7528\u6237\u540d\u548c\u5bc6\u7801, \u8fd9\u4e2a\u53ef\u4ee5\u4e0d\u8bbe\u7f6e&#xff0c;\u53ea\u6709\u9700\u8981\u9274\u6743\u7684\u518d\u8bbe\u7f6e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u83b7\u53d6rtsp server\u5f53\u524d\u4f1a\u8bdd\u6570<\/p>\n<\/td>\n<td>\n<p>GetRtspServerClientSessionNumbers<\/p>\n<\/td>\n<td>\n<p>\u83b7\u53d6rtsp server\u5f53\u524d\u7684\u5ba2\u6237\u4f1a\u8bdd\u6570, \u8fd9\u4e2a\u63a5\u53e3\u5fc5\u987b\u5728StartRtspServer\u4e4b\u540e\u518d\u8c03\u7528<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u542f\u52a8rtsp server<\/p>\n<\/td>\n<td>\n<p>StartRtspServer<\/p>\n<\/td>\n<td>\n<p>\u542f\u52a8rtsp server<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u505c\u6b62rtsp server<\/p>\n<\/td>\n<td>\n<p>StopRtspServer<\/p>\n<\/td>\n<td>\n<p>\u505c\u6b62rtsp server<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u5173\u95edrtsp server<\/p>\n<\/td>\n<td>\n<p>CloseRtspServer<\/p>\n<\/td>\n<td>\n<p>\u5173\u95edrtsp server<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>UnInit rtsp server<\/p>\n<\/td>\n<td>\n<p>UnInitRtspServer<\/p>\n<\/td>\n<td>\n<p>UnInit rtsp server(\u548cInitRtspServer\u914d\u5bf9\u4f7f\u7528&#xff0c;\u5373\u4fbf\u662f\u542f\u52a8\u591a\u4e2aRTSP\u670d\u52a1&#xff0c;\u4e5f\u53ea\u9700\u8c03\u7528\u4e00\u6b21UnInitRtspServer)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">\n<p>SmartRTSPServerSDK\u4f9bPublisher\u8c03\u7528\u7684\u63a5\u53e3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u8bbe\u7f6ertsp\u7684\u6d41\u540d\u79f0<\/p>\n<\/td>\n<td>\n<p>SetRtspStreamName<\/p>\n<\/td>\n<td>\n<p>\u8bbe\u7f6ertsp\u7684\u6d41\u540d\u79f0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u7ed9\u8981\u53d1\u5e03\u7684rtsp\u6d41\u8bbe\u7f6ertsp server<\/p>\n<\/td>\n<td>\n<p>AddRtspStreamServer<\/p>\n<\/td>\n<td>\n<p>\u7ed9\u8981\u53d1\u5e03\u7684rtsp\u6d41\u8bbe\u7f6ertsp server, \u4e00\u4e2a\u6d41\u53ef\u4ee5\u53d1\u5e03\u5230\u591a\u4e2artsp server\u4e0a&#xff0c;rtsp server\u7684\u521b\u5efa\u542f\u52a8\u8bf7\u53c2\u8003OpenRtspServer\u548cStartRtspServer\u63a5\u53e3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u6e05\u9664\u8bbe\u7f6e\u7684rtsp server<\/p>\n<\/td>\n<td>\n<p>ClearRtspStreamServer<\/p>\n<\/td>\n<td>\n<p>\u6e05\u9664\u8bbe\u7f6e\u7684rtsp server<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u542f\u52a8rtsp\u6d41<\/p>\n<\/td>\n<td>\n<p>StartRtspStream<\/p>\n<\/td>\n<td>\n<p>\u542f\u52a8rtsp\u6d41<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u505c\u6b62rtsp\u6d41<\/p>\n<\/td>\n<td>\n<p>StopRtspStream<\/p>\n<\/td>\n<td>\n<p>\u505c\u6b62rtsp\u6d41<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u8c03\u7528\u903b\u8f91<\/h4>\n<p>\u4ee5\u5927\u725b\u76f4\u64adSDK\u7684Android\u5e73\u53f0Camera2\u5bf9\u63a5\u4e3a\u4f8b&#xff0c;\u5148\u521d\u59cb\u5316RTSP Server&#xff0c;\u542f\u52a8RTSP\u670d\u52a1&#xff0c;\u7136\u540e\u53d1\u5e03RTSP\u6d41\u5373\u53ef&#xff0c;\u5982\u679c\u9700\u8981\u505c\u6b62RTSP\u670d\u52a1&#xff0c;\u90a3\u4e48\u5148\u505c\u6b62RTSP\u6d41&#xff0c;\u518d\u505c\u6b62RTSP\u670d\u52a1\u5373\u53ef&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418161802-68027b3a4cdcd.jpg\" \/><\/p>\n<p>\/*<br \/>\n * MainActivity.java<br \/>\n * Author: daniusdk.com<br \/>\n * WeChat: xinsheng120<br \/>\n *\/<br \/>\n&#064;Override<br \/>\nprotected void onCreate(Bundle savedInstanceState) {<br \/>\nsuper.onCreate(savedInstanceState);<br \/>\nsetContentView(R.layout.activity_main);<\/p>\n<p>&#8230;<\/p>\n<p>context_ &#061; this.getApplicationContext();<\/p>\n<p>libPublisher &#061; new SmartPublisherJniV2();<\/p>\n<p>libPublisher.InitRtspServer(context_);      \/\/\u548cUnInitRtspServer\u914d\u5bf9\u4f7f\u7528&#xff0c;\u5373\u4fbf\u662f\u542f\u52a8\u591a\u4e2aRTSP\u670d\u52a1&#xff0c;\u4e5f\u53ea\u9700\u8c03\u7528\u4e00\u6b21InitRtspServer&#xff0c;\u8bf7\u786e\u4fdd\u5728OpenRtspServer\u4e4b\u524d\u8c03\u7528<br \/>\n} <\/p>\n<p>\u542f\u52a8\u3001\u505c\u6b62RTSP\u670d\u52a1&#xff1a;<\/p>\n<p>\/\/\u542f\u52a8\/\u505c\u6b62RTSP\u670d\u52a1<br \/>\nclass ButtonRtspServiceListener implements View.OnClickListener {<br \/>\npublic void onClick(View v) {<br \/>\nif (isRTSPServiceRunning) {<br \/>\nstopRtspService();<\/p>\n<p>btnRtspService.setText(&#034;\u542f\u52a8RTSP\u670d\u52a1&#034;);<br \/>\nbtnRtspPublisher.setEnabled(false);<\/p>\n<p>isRTSPServiceRunning &#061; false;<br \/>\nreturn;<br \/>\n}<\/p>\n<p>Log.i(TAG, &#034;onClick start rtsp service..&#034;);<\/p>\n<p>rtsp_handle_ &#061; libPublisher.OpenRtspServer(0);<\/p>\n<p>if (rtsp_handle_ &#061;&#061; 0) {<br \/>\nLog.e(TAG, &#034;\u521b\u5efartsp server\u5b9e\u4f8b\u5931\u8d25! \u8bf7\u68c0\u67e5SDK\u6709\u6548\u6027&#034;);<br \/>\n} else {<br \/>\nint port &#061; 8554;<br \/>\nif (libPublisher.SetRtspServerPort(rtsp_handle_, port) !&#061; 0) {<br \/>\nlibPublisher.CloseRtspServer(rtsp_handle_);<br \/>\nrtsp_handle_ &#061; 0;<br \/>\nLog.e(TAG, &#034;\u521b\u5efartsp server\u7aef\u53e3\u5931\u8d25! \u8bf7\u68c0\u67e5\u7aef\u53e3\u662f\u5426\u91cd\u590d\u6216\u8005\u7aef\u53e3\u4e0d\u5728\u8303\u56f4\u5185!&#034;);<br \/>\n}<\/p>\n<p>if (libPublisher.StartRtspServer(rtsp_handle_, 0) &#061;&#061; 0) {<br \/>\nLog.i(TAG, &#034;\u542f\u52a8rtsp server \u6210\u529f!&#034;);<br \/>\n} else {<br \/>\nlibPublisher.CloseRtspServer(rtsp_handle_);<br \/>\nrtsp_handle_ &#061; 0;<br \/>\nLog.e(TAG, &#034;\u542f\u52a8rtsp server\u5931\u8d25! \u8bf7\u68c0\u67e5\u8bbe\u7f6e\u7684\u7aef\u53e3\u662f\u5426\u88ab\u5360\u7528!&#034;);<br \/>\n}<\/p>\n<p>btnRtspService.setText(&#034;\u505c\u6b62RTSP\u670d\u52a1&#034;);<br \/>\nbtnRtspPublisher.setEnabled(true);<\/p>\n<p>isRTSPServiceRunning &#061; true;<br \/>\n}<br \/>\n}<br \/>\n} <\/p>\n<p>stopRtspService()\u5b9e\u73b0\u5982\u4e0b&#xff1a;<\/p>\n<p>\/\/\u505c\u6b62RTSP\u670d\u52a1<br \/>\nprivate void stopRtspService() {<br \/>\nif(!isRTSPServiceRunning)<br \/>\n{<br \/>\nreturn;<br \/>\n}<br \/>\nif (libPublisher !&#061; null &amp;&amp; rtsp_handle_ !&#061; 0) {<br \/>\nlibPublisher.StopRtspServer(rtsp_handle_);<br \/>\nlibPublisher.CloseRtspServer(rtsp_handle_);<br \/>\nrtsp_handle_ &#061; 0;<br \/>\n}<br \/>\n} <\/p>\n<p>\u53d1\u5e03\u3001\u505c\u6b62RTSP\u6d41&#xff1a;<\/p>\n<p>\/\/\u53d1\u5e03\/\u505c\u6b62RTSP\u6d41<br \/>\nclass ButtonRtspPublisherListener implements View.OnClickListener {<br \/>\npublic void onClick(View v) {<br \/>\nif (stream_publisher_.is_rtsp_publishing()) {<br \/>\nstopRtspPublisher();<\/p>\n<p>btnRtspPublisher.setText(&#034;\u53d1\u5e03RTSP\u6d41&#034;);<br \/>\nbtnGetRtspSessionNumbers.setEnabled(false);<br \/>\nbtnRtspService.setEnabled(true);<br \/>\nreturn;<br \/>\n}<\/p>\n<p>Log.i(TAG, &#034;onClick start rtsp publisher..&#034;);<\/p>\n<p>InitAndSetConfig();<\/p>\n<p>String rtsp_stream_name &#061; &#034;stream1&#034;;<br \/>\nstream_publisher_.SetRtspStreamName(rtsp_stream_name);<br \/>\nstream_publisher_.ClearRtspStreamServer();<\/p>\n<p>stream_publisher_.AddRtspStreamServer(rtsp_handle_);<\/p>\n<p>if (!stream_publisher_.StartRtspStream()) {<br \/>\nstream_publisher_.try_release();<br \/>\nLog.e(TAG, &#034;\u8c03\u7528\u53d1\u5e03rtsp\u6d41\u63a5\u53e3\u5931\u8d25!&#034;);<br \/>\nreturn;<br \/>\n}<\/p>\n<p>startAudioRecorder();<br \/>\nstartLayerPostThread();<\/p>\n<p>btnRtspPublisher.setText(&#034;\u505c\u6b62RTSP\u6d41&#034;);<br \/>\nbtnGetRtspSessionNumbers.setEnabled(true);<br \/>\nbtnRtspService.setEnabled(false);<br \/>\n}<br \/>\n} <\/p>\n<p>stopRtspPublisher()\u5b9e\u73b0\u5982\u4e0b&#xff1a;<\/p>\n<p>\/\/\u505c\u6b62\u53d1\u5e03RTSP\u6d41<br \/>\nprivate void stopRtspPublisher() {<br \/>\nstream_publisher_.StopRtspStream();<br \/>\nstream_publisher_.try_release();<\/p>\n<p>if (!stream_publisher_.is_publishing())<br \/>\nstopAudioRecorder();<br \/>\n} <\/p>\n<p>\u5176\u4e2d&#xff0c;InitAndSetConfig()\u5b9e\u73b0\u5982\u4e0b&#xff0c;\u901a\u8fc7\u8c03\u7814SmartPublisherOpen()\u63a5\u53e3&#xff0c;\u751f\u6210\u63a8\u9001\u5b9e\u4f8b\u53e5\u67c4\u3002<\/p>\n<p>\/*<br \/>\n * MainActivity.java<br \/>\n * Author: daniusdk.com<br \/>\n *\/<br \/>\nprivate void InitAndSetConfig() {<br \/>\nif (null &#061;&#061; libPublisher)<br \/>\nreturn;<\/p>\n<p>if (!stream_publisher_.empty())<br \/>\nreturn;<\/p>\n<p>Log.i(TAG, &#034;InitAndSetConfig video width: &#034; &#043; video_width_ &#043; &#034;, height&#034; &#043; video_height_ &#043; &#034; imageRotationDegree:&#034; &#043; cameraImageRotationDegree_);<\/p>\n<p>int audio_opt &#061; 1;<br \/>\nlong handle &#061; libPublisher.SmartPublisherOpen(context_, audio_opt, 3,  video_width_, video_height_);<br \/>\nif (0&#061;&#061;handle) {<br \/>\nLog.e(TAG, &#034;sdk open failed!&#034;);<br \/>\nreturn;<br \/>\n}<\/p>\n<p>Log.i(TAG, &#034;publisherHandle&#061;&#034; &#043; handle);<\/p>\n<p>int fps &#061; 25;<br \/>\nint gop &#061; fps * 3;<\/p>\n<p>initialize_publisher(libPublisher, handle, video_width_, video_height_, fps, gop);<\/p>\n<p>stream_publisher_.set(libPublisher, handle);<br \/>\n} <\/p>\n<p>\u5bf9\u5e94\u7684initialize_publisher()\u5b9e\u73b0\u5982\u4e0b&#xff0c;\u8bbe\u7f6e\u8f6f\u786c\u7f16\u7801\u3001\u5e27\u7387\u3001\u5173\u952e\u5e27\u95f4\u9694\u7b49\u3002<\/p>\n<p>private boolean initialize_publisher(SmartPublisherJniV2 lib_publisher, long handle, int width, int height, int fps, int gop) {<br \/>\nif (null &#061;&#061; lib_publisher) {<br \/>\nLog.e(TAG, &#034;initialize_publisher lib_publisher is null&#034;);<br \/>\nreturn false;<br \/>\n}<\/p>\n<p>if (0 &#061;&#061; handle) {<br \/>\nLog.e(TAG, &#034;initialize_publisher handle is 0&#034;);<br \/>\nreturn false;<br \/>\n}<\/p>\n<p>if (videoEncodeType &#061;&#061; 1) {<br \/>\nint kbps &#061; LibPublisherWrapper.estimate_video_hardware_kbps(width, height, fps, true);<br \/>\nLog.i(TAG, &#034;h264HWKbps: &#034; &#043; kbps);<br \/>\nint isSupportH264HWEncoder &#061; lib_publisher.SetSmartPublisherVideoHWEncoder(handle, kbps);<br \/>\nif (isSupportH264HWEncoder &#061;&#061; 0) {<br \/>\nlib_publisher.SetNativeMediaNDK(handle, 0);<br \/>\nlib_publisher.SetVideoHWEncoderBitrateMode(handle, 1); \/\/ 0:CQ, 1:VBR, 2:CBR<br \/>\nlib_publisher.SetVideoHWEncoderQuality(handle, 39);<br \/>\nlib_publisher.SetAVCHWEncoderProfile(handle, 0x08); \/\/ 0x01: Baseline, 0x02: Main, 0x08: High<\/p>\n<p>\/\/ lib_publisher.SetAVCHWEncoderLevel(handle, 0x200); \/\/ Level 3.1<br \/>\n\/\/ lib_publisher.SetAVCHWEncoderLevel(handle, 0x400); \/\/ Level 3.2<br \/>\n\/\/ lib_publisher.SetAVCHWEncoderLevel(handle, 0x800); \/\/ Level 4<br \/>\nlib_publisher.SetAVCHWEncoderLevel(handle, 0x1000); \/\/ Level 4.1 \u591a\u6570\u60c5\u51b5\u4e0b,\u8fd9\u4e2a\u591f\u7528\u4e86<br \/>\n\/\/lib_publisher.SetAVCHWEncoderLevel(handle, 0x2000); \/\/ Level 4.2<\/p>\n<p>\/\/ lib_publisher.SetVideoHWEncoderMaxBitrate(handle, ((long)h264HWKbps)*1300);<\/p>\n<p>Log.i(TAG, &#034;Great, it supports h.264 hardware encoder!&#034;);<br \/>\n}<br \/>\n} else if (videoEncodeType &#061;&#061; 2) {<br \/>\nint kbps &#061; LibPublisherWrapper.estimate_video_hardware_kbps(width, height, fps, false);<br \/>\nLog.i(TAG, &#034;hevcHWKbps: &#034; &#043; kbps);<br \/>\nint isSupportHevcHWEncoder &#061; lib_publisher.SetSmartPublisherVideoHevcHWEncoder(handle, kbps);<br \/>\nif (isSupportHevcHWEncoder &#061;&#061; 0) {<br \/>\nlib_publisher.SetNativeMediaNDK(handle, 0);<br \/>\nlib_publisher.SetVideoHWEncoderBitrateMode(handle, 1); \/\/ 0:CQ, 1:VBR, 2:CBR<br \/>\nlib_publisher.SetVideoHWEncoderQuality(handle, 39);<\/p>\n<p>\/\/ libPublisher.SetVideoHWEncoderMaxBitrate(handle, ((long)hevcHWKbps)*1200);<\/p>\n<p>Log.i(TAG, &#034;Great, it supports hevc hardware encoder!&#034;);<br \/>\n}<br \/>\n}<\/p>\n<p>boolean is_sw_vbr_mode &#061; true;<br \/>\n\/\/H.264 software encoder<br \/>\nif (is_sw_vbr_mode) {<br \/>\nint is_enable_vbr &#061; 1;<br \/>\nint video_quality &#061; LibPublisherWrapper.estimate_video_software_quality(width, height, true);<br \/>\nint vbr_max_kbps &#061; LibPublisherWrapper.estimate_video_vbr_max_kbps(width, height, fps);<br \/>\nlib_publisher.SmartPublisherSetSwVBRMode(handle, is_enable_vbr, video_quality, vbr_max_kbps);<br \/>\n}<\/p>\n<p>if (is_pcma_) {<br \/>\nlib_publisher.SmartPublisherSetAudioCodecType(handle, 3);<br \/>\n} else {<br \/>\nlib_publisher.SmartPublisherSetAudioCodecType(handle, 1);<br \/>\n}<\/p>\n<p>lib_publisher.SetSmartPublisherEventCallbackV2(handle, new EventHandlerPublisherV2().set(handler_, record_executor_));<\/p>\n<p>lib_publisher.SmartPublisherSetSWVideoEncoderProfile(handle, 3);<\/p>\n<p>lib_publisher.SmartPublisherSetSWVideoEncoderSpeed(handle, 2);<\/p>\n<p>lib_publisher.SmartPublisherSetGopInterval(handle, gop);<\/p>\n<p>lib_publisher.SmartPublisherSetFPS(handle, fps);<\/p>\n<p>\/\/ lib_publisher.SmartPublisherSetSWVideoBitRate(handle, 600, 1200);<\/p>\n<p>boolean is_noise_suppression &#061; true;<br \/>\nlib_publisher.SmartPublisherSetNoiseSuppression(handle, is_noise_suppression ? 1 : 0);<\/p>\n<p>boolean is_agc &#061; false;<br \/>\nlib_publisher.SmartPublisherSetAGC(handle, is_agc ? 1 : 0);<\/p>\n<p>int echo_cancel_delay &#061; 0;<br \/>\nlib_publisher.SmartPublisherSetEchoCancellation(handle, 1, echo_cancel_delay);<\/p>\n<p>return true;<br \/>\n} <\/p>\n<p>\u53d1\u5e03RTSP\u6d41\u6210\u529f\u540e&#xff0c;\u4f1a\u56de\u8c03\u4e0a\u6765\u53ef\u4f9b\u62c9\u6d41\u7684RTSP URL&#xff1a;<\/p>\n<p>private static class EventHandlerPublisherV2 implements NTSmartEventCallbackV2 {<br \/>\n&#064;Override<br \/>\npublic void onNTSmartEventCallbackV2(long handle, int id, long param1, long param2, String param3, String param4, Object param5) {<\/p>\n<p>switch (id) {<br \/>\n&#8230;<br \/>\ncase NTSmartEventID.EVENT_DANIULIVE_ERC_PUBLISHER_RTSP_URL:<br \/>\npublisher_event &#061; &#034;RTSP\u670d\u52a1URL: &#034; &#043; param3;<br \/>\nbreak;<br \/>\n}<br \/>\n}<br \/>\n} <\/p>\n<p>\u83b7\u53d6RTSP Session\u4f1a\u8bdd\u6570&#xff1a;<\/p>\n<p>\/\/\u83b7\u53d6RTSP\u4f1a\u8bdd\u6570<br \/>\nclass ButtonGetRtspSessionNumbersListener implements View.OnClickListener {<br \/>\npublic void onClick(View v) {<br \/>\nif (libPublisher !&#061; null &amp;&amp; rtsp_handle_ !&#061; 0) {<br \/>\nint session_numbers &#061; libPublisher.GetRtspServerClientSessionNumbers(rtsp_handle_);<\/p>\n<p>Log.i(TAG, &#034;GetRtspSessionNumbers: &#034; &#043; session_numbers);<\/p>\n<p>PopRtspSessionNumberDialog(session_numbers);<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/\u5f53\u524dRTSP\u4f1a\u8bdd\u6570\u5f39\u51fa\u6846<br \/>\nprivate void PopRtspSessionNumberDialog(int session_numbers) {<br \/>\nfinal EditText inputUrlTxt &#061; new EditText(this);<br \/>\ninputUrlTxt.setFocusable(true);<br \/>\ninputUrlTxt.setEnabled(false);<\/p>\n<p>String session_numbers_tag &#061; &#034;RTSP\u670d\u52a1\u5f53\u524d\u5ba2\u6237\u4f1a\u8bdd\u6570: &#034; &#043; session_numbers;<br \/>\ninputUrlTxt.setText(session_numbers_tag);<\/p>\n<p>AlertDialog.Builder builderUrl &#061; new AlertDialog.Builder(this);<br \/>\nbuilderUrl<br \/>\n.setTitle(&#034;\u5185\u7f6eRTSP\u670d\u52a1&#034;)<br \/>\n.setView(inputUrlTxt).setNegativeButton(&#034;\u786e\u5b9a&#034;, null);<br \/>\nbuilderUrl.show();<br \/>\n}<\/p>\n<p>onDestroy() \u7684\u65f6\u5019&#xff0c;\u8c03\u7814UnInitRtspServer()\u5373\u53ef&#xff1a;<\/p>\n<p>&#064;Override<br \/>\nprotected void onDestroy() {<br \/>\nLog.i(TAG, &#034;activity destory!&#034;);<\/p>\n<p>stopAudioRecorder();<\/p>\n<p>stopRtspPublisher();<br \/>\nstopRtspService();<br \/>\nisRTSPServiceRunning &#061; false;<\/p>\n<p>stream_publisher_.release();<\/p>\n<p>if (libPublisher !&#061; null)<br \/>\nlibPublisher.UnInitRtspServer();      \/\/\u5982\u5df2\u542f\u7528\u5185\u7f6e\u670d\u52a1\u529f\u80fd(InitRtspServer)&#xff0c;\u8c03\u7528UnInitRtspServer, \u6ce8\u610f&#xff0c;\u5373\u4fbf\u662f\u542f\u52a8\u591a\u4e2aRTSP\u670d\u52a1&#xff0c;\u4e5f\u53ea\u9700\u8c03\u7528UnInitRtspServer\u4e00\u6b21<\/p>\n<p>stopLayerPostThread();<\/p>\n<p>if (camera2Helper !&#061; null) {<br \/>\ncamera2Helper.release();<br \/>\n}<\/p>\n<p>super.onDestroy();<br \/>\n} <\/p>\n<h3>\u603b\u7ed3<\/h3>\n<p>Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668\u662f\u4e00\u4e2a\u6781\u5177\u6311\u6218\u7684\u4efb\u52a1&#xff0c;\u529f\u80fd\u8bbe\u8ba1\u8fd9\u5757&#xff0c;\u9664\u4e86\u9700\u8981\u652f\u6301\u63a5\u7f16\u7801\u524d\u97f3\u89c6\u9891\u6570\u636e\u5916&#xff0c;\u8fd8\u9700\u8981\u652f\u6301\u5bf9\u63a5\u7f16\u7801\u540e\u97f3\u89c6\u9891\u6570\u636e&#xff0c;\u5e76\u5b9e\u73b0\u672c\u5730\u5f55\u50cf\u3001\u5feb\u7167\u7b49\u529f\u80fd\u7ec4\u5408\u4f7f\u7528\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u5c31\u50cf\u6d77\u5eb7\u3001\u5927\u534e\u7684\u6444\u50cf\u5934\u4e00\u6837&#xff0c;\u5bf9\u5916\u7684\u5e76\u53d1&#xff0c;\u4e00\u822c\u9650\u4e8e4-8\u4e2a&#xff0c;Android\u8bbe\u5907\u7684\u6027\u80fd\u4e00\u822c\u6765\u8bf4&#xff0c;\u53ef\u80fd\u4e0d\u8db3\u4ee5\u5904\u7406\u9ad8\u8d1f\u8f7d\u7684RTSP\u670d\u52a1\u5668&#xff0c;\u4f46\u662f\u5c0f\u5e76\u53d1\u6a21\u5f0f\u4e0b&#xff0c;\u80fd\u7a33\u5b9a\u7684\u8fd0\u884c&#xff0c;\u5c31\u8fbe\u5230\u8bbe\u8ba1\u521d\u8877\u4e86&#xff0c;\u611f\u5174\u8da3\u7684\u5f00\u53d1\u8005&#xff0c;\u53ef\u4ee5\u5355\u72ec\u8ddf\u5355\u72ec\u63a2\u8ba8\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb3.5k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf26\u6b21\u3002Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668\u662f\u4e00\u4e2a\u6781\u5177\u6311\u6218\u7684\u4efb\u52a1\uff0c\u529f\u80fd\u8bbe\u8ba1\u8fd9\u5757\uff0c\u9664\u4e86\u9700\u8981\u652f\u6301\u63a5\u7f16\u7801\u524d\u97f3\u89c6\u9891\u6570\u636e\u5916\uff0c\u8fd8\u9700\u8981\u652f\u6301\u5bf9\u63a5\u7f16\u7801\u540e\u97f3\u89c6\u9891\u6570\u636e\uff0c\u5e76\u5b9e\u73b0\u672c\u5730\u5f55\u50cf\u3001\u5feb\u7167\u7b49\u529f\u80fd\u7ec4\u5408\u4f7f\u7528\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5c31\u50cf\u6d77\u5eb7\u3001\u5927\u534e\u7684\u6444\u50cf\u5934\u4e00\u6837\uff0c\u5bf9\u5916\u7684\u5e76\u53d1\uff0c\u4e00\u822c\u9650\u4e8e4-8\u4e2a\uff0cAndroid\u8bbe\u5907\u7684\u6027\u80fd\u4e00\u822c\u6765\u8bf4\uff0c\u53ef\u80fd\u4e0d\u8db3\u4ee5\u5904\u7406\u9ad8\u8d1f\u8f7d\u7684RTSP\u670d\u52a1\u5668\uff0c\u4f46\u662f\u5c0f\u5e76\u53d1\u6a21\u5f0f\u4e0b\uff0c\u80fd\u7a33\u5b9a\u7684\u8fd0\u884c\uff0c\u5c31\u8fbe\u5230\u8bbe\u8ba1\u521d\u8877\u4e86\u3002_android rtsp<\/p>\n","protected":false},"author":2,"featured_media":17756,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[84,1337,1336,1335,1340,1338,1339,1334],"topic":[],"class_list":["post-17758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-android","tag-android-rtsp","tag-rtsp-server","tag-rtsp","tag-sdk"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u5728Android\u4e0a\u5b9e\u73b0RTSP\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\/17758.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u5728Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb3.5k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf26\u6b21\u3002Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668\u662f\u4e00\u4e2a\u6781\u5177\u6311\u6218\u7684\u4efb\u52a1\uff0c\u529f\u80fd\u8bbe\u8ba1\u8fd9\u5757\uff0c\u9664\u4e86\u9700\u8981\u652f\u6301\u63a5\u7f16\u7801\u524d\u97f3\u89c6\u9891\u6570\u636e\u5916\uff0c\u8fd8\u9700\u8981\u652f\u6301\u5bf9\u63a5\u7f16\u7801\u540e\u97f3\u89c6\u9891\u6570\u636e\uff0c\u5e76\u5b9e\u73b0\u672c\u5730\u5f55\u50cf\u3001\u5feb\u7167\u7b49\u529f\u80fd\u7ec4\u5408\u4f7f\u7528\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5c31\u50cf\u6d77\u5eb7\u3001\u5927\u534e\u7684\u6444\u50cf\u5934\u4e00\u6837\uff0c\u5bf9\u5916\u7684\u5e76\u53d1\uff0c\u4e00\u822c\u9650\u4e8e4-8\u4e2a\uff0cAndroid\u8bbe\u5907\u7684\u6027\u80fd\u4e00\u822c\u6765\u8bf4\uff0c\u53ef\u80fd\u4e0d\u8db3\u4ee5\u5904\u7406\u9ad8\u8d1f\u8f7d\u7684RTSP\u670d\u52a1\u5668\uff0c\u4f46\u662f\u5c0f\u5e76\u53d1\u6a21\u5f0f\u4e0b\uff0c\u80fd\u7a33\u5b9a\u7684\u8fd0\u884c\uff0c\u5c31\u8fbe\u5230\u8bbe\u8ba1\u521d\u8877\u4e86\u3002_android rtsp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/17758.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-18T16:18:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418161802-68027b3a14c91.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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/17758.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/17758.html\",\"name\":\"\u5982\u4f55\u5728Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T16:18:04+00:00\",\"dateModified\":\"2025-04-18T16:18:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/17758.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/17758.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/17758.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u5728Android\u4e0a\u5b9e\u73b0RTSP\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":"\u5982\u4f55\u5728Android\u4e0a\u5b9e\u73b0RTSP\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\/17758.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u5728Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb3.5k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf26\u6b21\u3002Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668\u662f\u4e00\u4e2a\u6781\u5177\u6311\u6218\u7684\u4efb\u52a1\uff0c\u529f\u80fd\u8bbe\u8ba1\u8fd9\u5757\uff0c\u9664\u4e86\u9700\u8981\u652f\u6301\u63a5\u7f16\u7801\u524d\u97f3\u89c6\u9891\u6570\u636e\u5916\uff0c\u8fd8\u9700\u8981\u652f\u6301\u5bf9\u63a5\u7f16\u7801\u540e\u97f3\u89c6\u9891\u6570\u636e\uff0c\u5e76\u5b9e\u73b0\u672c\u5730\u5f55\u50cf\u3001\u5feb\u7167\u7b49\u529f\u80fd\u7ec4\u5408\u4f7f\u7528\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5c31\u50cf\u6d77\u5eb7\u3001\u5927\u534e\u7684\u6444\u50cf\u5934\u4e00\u6837\uff0c\u5bf9\u5916\u7684\u5e76\u53d1\uff0c\u4e00\u822c\u9650\u4e8e4-8\u4e2a\uff0cAndroid\u8bbe\u5907\u7684\u6027\u80fd\u4e00\u822c\u6765\u8bf4\uff0c\u53ef\u80fd\u4e0d\u8db3\u4ee5\u5904\u7406\u9ad8\u8d1f\u8f7d\u7684RTSP\u670d\u52a1\u5668\uff0c\u4f46\u662f\u5c0f\u5e76\u53d1\u6a21\u5f0f\u4e0b\uff0c\u80fd\u7a33\u5b9a\u7684\u8fd0\u884c\uff0c\u5c31\u8fbe\u5230\u8bbe\u8ba1\u521d\u8877\u4e86\u3002_android rtsp","og_url":"https:\/\/www.wsisp.com\/helps\/17758.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T16:18:04+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418161802-68027b3a14c91.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/17758.html","url":"https:\/\/www.wsisp.com\/helps\/17758.html","name":"\u5982\u4f55\u5728Android\u4e0a\u5b9e\u73b0RTSP\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T16:18:04+00:00","dateModified":"2025-04-18T16:18:04+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/17758.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/17758.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/17758.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u5728Android\u4e0a\u5b9e\u73b0RTSP\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\/17758","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=17758"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/17758\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/17756"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=17758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=17758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=17758"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=17758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}