{"id":6669,"date":"2025-09-29T12:42:24","date_gmt":"2025-09-29T04:42:24","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=6669"},"modified":"2025-09-29T12:42:54","modified_gmt":"2025-09-29T04:42:54","slug":"%e4%bb%8e-0-%e5%88%b0-1%ef%bc%8c%e5%ae%9e%e6%88%98-springboot-%e6%89%93%e9%80%a0%e8%bd%bb%e9%87%8f%e8%a7%86%e9%a2%91%e6%8e%a8%e6%8b%89%e6%b5%81%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/%e4%bb%8e-0-%e5%88%b0-1%ef%bc%8c%e5%ae%9e%e6%88%98-springboot-%e6%89%93%e9%80%a0%e8%bd%bb%e9%87%8f%e8%a7%86%e9%a2%91%e6%8e%a8%e6%8b%89%e6%b5%81%e7%b3%bb%e7%bb%9f\/","title":{"rendered":"\u4ece 0 \u5230 1\uff0c\u5b9e\u6218 SpringBoot \u6253\u9020\u8f7b\u91cf\u89c6\u9891\u63a8\u62c9\u6d41\u7cfb\u7edf"},"content":{"rendered":"\n<p>\u5728\u667a\u6167\u5b89\u9632\u3001\u5728\u7ebf\u6559\u80b2\u76f4\u64ad\u3001\u6237\u5916\u8bbe\u5907\u5b9e\u65f6\u56de\u4f20\u7b49\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u89c6\u9891\u63a8\u62c9\u6d41\u662f\u6838\u5fc3\u57fa\u7840\u80fd\u529b\u3002\u6700\u521d\u6211\u5c1d\u8bd5\u57fa\u4e8e Netty \u624b\u52a8\u5c01\u88c5 RTSP \u534f\u8bae\u5b9e\u73b0\u670d\u52a1 \u2014\u2014 \u65e2\u8981\u5904\u7406 RTSP \u7684\u4fe1\u4ee4\u4ea4\u4e92\uff0c\u53c8\u8981\u89e3\u51b3\u89c6\u9891\u5e27\u89e3\u5305\u7684\u65f6\u5e8f\u540c\u6b65\u95ee\u9898\uff0c\u5b9e\u9645\u5f00\u53d1\u4e2d\u4e0d\u4ec5\u9047\u5230\u89e3\u5305\u6548\u7387\u4f4e\u7684\u74f6\u9888\uff0c\u8fd8\u51fa\u73b0\u4e86\u4e0d\u540c\u8bbe\u5907\u517c\u5bb9\u6027\u5dee\u7684\u95ee\u9898\uff0c\u81ea\u7814\u6210\u672c\u8fdc\u8d85\u9884\u671f\u3002<\/p>\n\n\n\n<p>\u540e\u6765\u5076\u7136\u53d1\u73b0<strong>Zlm4j<\/strong>\u8fd9\u4e2a\u5de5\u5177\uff1a\u5b83\u662f\u57fa\u4e8e\u9ad8\u6027\u80fd\u6d41\u5a92\u4f53\u6846\u67b6 ZLMediaKit \u5c01\u88c5\u7684 JNA \u63a5\u53e3\uff0c\u80fd\u76f4\u63a5\u4e0e SpringBoot \u65e0\u7f1d\u96c6\u6210\uff0c\u7701\u53bb\u4e86\u5e95\u5c42\u534f\u8bae\u89e3\u6790\u3001\u7aef\u53e3\u7ba1\u7406\u7b49\u7e41\u7410\u5de5\u4f5c\u3002\u7279\u522b\u611f\u8c22 ZLMediaKit \u4e0e Zlm4j \u7684\u5f00\u6e90\u56e2\u961f\uff0c\u8ba9\u6211\u4eec\u4e0d\u7528\u91cd\u590d\u9020\u8f6e\u5b50\uff0c\u5feb\u901f\u843d\u5730\u6d41\u5a92\u4f53\u670d\u52a1\u3002<\/p>\n\n\n\n<p>\u672c\u6587\u5c06\u7ed3\u5408\u5b8c\u6574\u4ee3\u7801\uff0c\u4e00\u6b65\u6b65\u6559\u4f60\u5728 SpringBoot \u4e2d\u642d\u5efa\u53ef\u76f4\u63a5\u590d\u7528\u7684\u89c6\u9891\u63a8\u62c9\u6d41\u7cfb\u7edf\uff0c\u6db5\u76d6\u63a8\u6d41\u9274\u6743\u3001\u591a\u534f\u8bae\u64ad\u653e\u3001\u524d\u7aef\u53ef\u89c6\u5316\u9875\u9762\uff0c\u5e2e\u52a9\u4f60\u8df3\u8fc7 \u201c\u8e29\u5751\u73af\u8282\u201d\uff0c\u76f4\u63a5\u5bf9\u63a5\u5b9e\u9645\u4e1a\u52a1\u9700\u6c42\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6838\u5fc3\u5b9e\u73b0\u6b65\u9aa4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e00\u6b65\uff1a\u5f15\u5165\u5173\u952e\u4f9d\u8d56<\/h3>\n\n\n\n<p>\u9879\u76ee\u6838\u5fc3\u4f9d\u8d56\u56f4\u7ed5 Zlm4j \u5c55\u5f00\uff0c\u540c\u65f6\u642d\u914d Web \u6a21\u5757\u4e0e Thymeleaf \u6a21\u677f\u5f15\u64ce\uff08\u7528\u4e8e\u524d\u7aef\u9875\u9762\uff09\uff0c\u65e0\u9700\u5355\u72ec\u5b89\u88c5 ZLMediaKit \u670d\u52a1\uff0cJNA \u4f1a\u81ea\u52a8\u5904\u7406\u5e95\u5c42\u8c03\u7528\u3002<\/p>\n\n\n\n<p><code>pom.xml<\/code>\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;!-- Zlm4j\uff1a\u5c01\u88c5ZLMediaKit\u6838\u5fc3\u80fd\u529b --&gt;<\/code><code>&lt;dependency&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;groupId&gt;com.aizuda&lt;\/groupId&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;artifactId&gt;zlm4j&lt;\/artifactId&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;version&gt;1.0.5&lt;\/version&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;scope&gt;system&lt;\/scope&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;systemPath&gt;${project.basedir}\/lib\/zlm4j-1.0.5.jar&lt;\/systemPath&gt;<\/code><code>&lt;\/dependency&gt;<\/code><code>&lt;!-- JNA\uff1a\u5904\u7406\u5e95\u5c42SDK\u8c03\u7528 --&gt;<\/code><code>&lt;dependency&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;groupId&gt;net.java.dev.jna&lt;\/groupId&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;artifactId&gt;jna&lt;\/artifactId&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;version&gt;5.15.0&lt;\/version&gt;<\/code><code>&lt;\/dependency&gt;<\/code><code>&lt;!-- SpringBoot Web\uff1a\u63d0\u4f9bHTTP\u670d\u52a1 --&gt;<\/code><code>&lt;dependency&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;<\/code><code>&lt;\/dependency&gt;<\/code><code>&lt;!-- Thymeleaf\uff1a\u524d\u7aef\u9875\u9762\u6e32\u67d3 --&gt;<\/code><code>&lt;dependency&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;\/artifactId&gt;<\/code><code>&lt;\/dependency&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e8c\u6b65\uff1a\u7f16\u5199\u914d\u7f6e\u7c7b\uff0c\u542f\u52a8\u591a\u534f\u8bae\u670d\u52a1<\/h3>\n\n\n\n<p>\u521b\u5efa\u914d\u7f6e\u7c7b<code>ZlmStreamConfig<\/code>\uff0c\u6838\u5fc3\u4f5c\u7528\u662f\u521d\u59cb\u5316 ZLMediaKit \u73af\u5883\u3001\u542f\u52a8 HTTP\/RTSP\/RTMP\/RTP \u7b49\u4e3b\u6d41\u6d41\u5a92\u4f53\u534f\u8bae\u670d\u52a1\uff0c\u540c\u65f6\u6ce8\u518c\u4e8b\u4ef6\u76d1\u542c\u8f7d\u4f53\u3002<\/p>\n\n\n\n<p>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>package&nbsp;com.stream.config;<\/code><code>import&nbsp;com.aizuda.zlm4j.core.ZLMApi;<\/code><code>import&nbsp;com.aizuda.zlm4j.structure.MK_EVENTS;<\/code><code>import&nbsp;com.sun.jna.Native;<\/code><code>import&nbsp;org.springframework.context.annotation.Bean;<\/code><code>import&nbsp;org.springframework.context.annotation.Configuration;<\/code><code>@Configuration<\/code><code>public&nbsp;class&nbsp;ZlmStreamConfig&nbsp;{<\/code><code>&nbsp; &nbsp;&nbsp;\/**<\/code><code>&nbsp; &nbsp; &nbsp;* \u521d\u59cb\u5316ZLMApi\uff0c\u542f\u52a8\u591a\u534f\u8bae\u670d\u52a1<\/code><code>&nbsp; &nbsp; &nbsp;*\/<\/code><code>&nbsp; &nbsp;&nbsp;@Bean<\/code><code>&nbsp; &nbsp;&nbsp;public&nbsp;ZLMApi&nbsp;zlmApi()&nbsp;{<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u52a0\u8f7dZLMediaKit\u6838\u5fc3\u5e93<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;ZLMApi&nbsp;zlmApi&nbsp;=&nbsp;Native.load(\"mk_api\", ZLMApi.class);<\/code><code><br><\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u521d\u59cb\u5316SDK\u73af\u5883\uff1a\u65e5\u5fd7\u5f00\u542f\u3001\u540e\u53f0\u8fd0\u884c\u3001\u9ed8\u8ba4\u914d\u7f6e<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; zlmApi.mk_env_init1(1,&nbsp;1,&nbsp;1,&nbsp;null,&nbsp;0,&nbsp;0,&nbsp;null,&nbsp;0,&nbsp;null,&nbsp;null);<\/code><code><br><\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u542f\u52a8\u5404\u534f\u8bae\u670d\u52a1\uff08\u7aef\u53e3\u53ef\u6839\u636e\u4e1a\u52a1\u8c03\u6574\uff09<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; zlmApi.mk_http_server_start((short)&nbsp;7789,&nbsp;0); &nbsp;\/\/ HTTP\u670d\u52a1\uff1a\u7528\u4e8eFLV\/HLS\u64ad\u653e<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; zlmApi.mk_rtsp_server_start((short)&nbsp;9758,&nbsp;0);&nbsp;\/\/ RTSP\u670d\u52a1\uff1a\u5e38\u7528\u4e8e\u8bbe\u5907\u63a8\u6d41<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; zlmApi.mk_rtmp_server_start((short)&nbsp;9760,&nbsp;0);&nbsp;\/\/ RTMP\u670d\u52a1\uff1a\u5e38\u7528\u4e8e\u76f4\u64ad\u5e73\u53f0<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; zlmApi.mk_rtp_server_start((short)&nbsp;32001); &nbsp; &nbsp;\/\/ RTP\u670d\u52a1\uff1a\u7528\u4e8e\u5b9e\u65f6\u5a92\u4f53\u4f20\u8f93<\/code><code><br><\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;zlmApi;<\/code><code>&nbsp; &nbsp; }<\/code><code>&nbsp; &nbsp;&nbsp;\/**<\/code><code>&nbsp; &nbsp; &nbsp;* \u6ce8\u518c\u4e8b\u4ef6\u76d1\u542c\u8f7d\u4f53\uff1a\u5904\u7406\u63a8\u6d41\u9274\u6743\u3001\u6d41\u72b6\u6001\u53d8\u5316\u7b49\u4e8b\u4ef6<\/code><code>&nbsp; &nbsp; &nbsp;*\/<\/code><code>&nbsp; &nbsp;&nbsp;@Bean<\/code><code>&nbsp; &nbsp;&nbsp;public&nbsp;MK_EVENTS&nbsp;mkEvents()&nbsp;{<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;new&nbsp;MK_EVENTS();<\/code><code>&nbsp; &nbsp; }<\/code><code>}<\/code><\/pre>\n\n\n\n<p>\u5404\u534f\u8bae\u7aef\u53e3\u8bf4\u660e\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u534f\u8bae<\/th><th>\u7aef\u53e3<\/th><th>\u7528\u9014<\/th><\/tr><\/thead><tbody><tr><td>HTTP<\/td><td>7789<\/td><td>\u63d0\u4f9b HTTP-FLV\u3001HLS \u683c\u5f0f\u89c6\u9891\u64ad\u653e<\/td><\/tr><tr><td>RTSP<\/td><td>9758<\/td><td>\u63a5\u6536\u8bbe\u5907\uff08\u5982\u6444\u50cf\u5934\uff09\u63a8\u6d41<\/td><\/tr><tr><td>RTMP<\/td><td>9760<\/td><td>\u63a5\u6536\u76f4\u64ad\u63a8\u6d41\u3001\u652f\u6301\u64ad\u653e\u5668\u64ad\u653e<\/td><\/tr><tr><td>RTP<\/td><td>32001<\/td><td>\u4f4e\u5ef6\u8fdf\u5b9e\u65f6\u5a92\u4f53\u6570\u636e\u4f20\u8f93<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e09\u6b65\uff1a\u5b9e\u73b0\u4e8b\u4ef6\u76d1\u542c\uff0c\u4fdd\u969c\u670d\u52a1\u5b89\u5168<\/h3>\n\n\n\n<p>\u5728 SpringBoot \u542f\u52a8\u7c7b\u4e2d\u5b9e\u73b0<code>CommandLineRunner<\/code>\u63a5\u53e3\uff0c\u6ce8\u518c<strong>\u63a8\u6d41\u9274\u6743<\/strong>\u548c<strong>\u6d41\u72b6\u6001\u76d1\u63a7<\/strong>\u4e8b\u4ef6 \u2014\u2014 \u524d\u8005\u9632\u6b62\u975e\u6cd5\u63a8\u6d41\uff0c\u540e\u8005\u5b9e\u65f6\u611f\u77e5\u6d41\u7684\u4e0a\u7ebf \/ \u4e0b\u7ebf\uff0c\u65b9\u4fbf\u6392\u67e5\u95ee\u9898\u3002https:\/\/wxa.wxs.qq.com\/tmpl\/oc\/base_tmpl.html<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"166\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-1024x166.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" alt=\"\" class=\"wp-image-6670 lazyload\" srcset=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-1024x166.png 1024w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-300x49.png 300w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-768x125.png 768w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-1536x250.png 1536w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-2048x333.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"166\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-1024x166.png\" alt=\"\" class=\"wp-image-6670\" srcset=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-1024x166.png 1024w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-300x49.png 300w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-768x125.png 768w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-1536x250.png 1536w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-2048x333.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/noscript><\/figure>\n\n\n\n<p>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>package com.stream;<\/code><code>import&nbsp;com.aizuda.zlm4j.core.ZLMApi;<\/code><code>import&nbsp;com.aizuda.zlm4j.structure.MK_EVENTS;<\/code><code>import&nbsp;org.springframework.beans.factory.annotation.Autowired;<\/code><code>import&nbsp;org.springframework.boot.CommandLineRunner;<\/code><code>import&nbsp;org.springframework.boot.SpringApplication;<\/code><code>import&nbsp;org.springframework.boot.autoconfigure.SpringBootApplication;<\/code><code>import&nbsp;java.util.Date;<\/code><code>@SpringBootApplication<\/code><code>public&nbsp;class&nbsp;VideoStreamApp&nbsp;implements&nbsp;CommandLineRunner&nbsp;{<\/code><code>&nbsp; &nbsp;&nbsp;@Autowired<\/code><code>&nbsp; &nbsp;&nbsp;private&nbsp;MK_EVENTS&nbsp;mkEvents;<\/code><code>&nbsp; &nbsp;&nbsp;@Autowired<\/code><code>&nbsp; &nbsp;&nbsp;private&nbsp;ZLMApi&nbsp;zlmApi;<\/code><code>&nbsp; &nbsp;&nbsp;public&nbsp;static&nbsp;void&nbsp;main(String[] args) {<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;SpringApplication.run(VideoStreamApp.class, args);<\/code><code>&nbsp; &nbsp; }<\/code><code>&nbsp; &nbsp;&nbsp;@Override<\/code><code>&nbsp; &nbsp;&nbsp;public&nbsp;void&nbsp;run(String... args) {<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ 1. \u63a8\u6d41\u9274\u6743\u4e8b\u4ef6\uff1a\u9a8c\u8bc1\u63a8\u6d41\u8bf7\u6c42\u5408\u6cd5\u6027<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; mkEvents.on_mk_media_publish&nbsp;= (urlInfo, invoker, sender) -&gt; {<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u83b7\u53d6\u63a8\u6d41\u643a\u5e26\u7684\u9274\u6743\u53c2\u6570\uff08\u5982token\uff09<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;authParams = zlmApi.mk_media_info_get_params(urlInfo);<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;System.out.println(\"[\"&nbsp;+&nbsp;new&nbsp;Date() +&nbsp;\"] \u63a8\u6d41\u9274\u6743\u53c2\u6570\uff1a\"&nbsp;+ authParams);<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u5b9e\u9645\u4e1a\u52a1\u4e2d\u53ef\u6821\u9a8ctoken\uff1a\u5408\u6cd5\u5219\u5141\u8bb8\u63a8\u6d41\uff080\u8868\u793a\u901a\u8fc7\uff09\uff0c\u975e\u6cd5\u5219\u62d2\u7edd<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;boolean&nbsp;isAuthPass = authParams.contains(\"token=stream2025\");<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zlmApi.mk_publish_auth_invoker_do(invoker,&nbsp;\"\", isAuthPass ?&nbsp;0&nbsp;:&nbsp;1,&nbsp;0);<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; };<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; zlmApi.mk_events_listen(mkEvents);<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ 2. \u6d41\u72b6\u6001\u53d8\u5316\u4e8b\u4ef6\uff1a\u76d1\u63a7\u6d41\u7684\u4e0a\u7ebf\/\u4e0b\u7ebf<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; mkEvents.on_mk_media_changed&nbsp;= (isOnline, sender) -&gt; {<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;appName = zlmApi.mk_media_source_get_app(sender);<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;streamName = zlmApi.mk_media_source_get_stream(sender);<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;protocol = zlmApi.mk_media_source_get_schema(sender);<\/code><code><br><\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;status = isOnline ==&nbsp;1&nbsp;?&nbsp;\"\u4e0a\u7ebf\"&nbsp;:&nbsp;\"\u4e0b\u7ebf\";<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;System.out.println(\"[\"&nbsp;+&nbsp;new&nbsp;Date() +&nbsp;\"] \u6d41\u72b6\u6001\u53d8\u5316\uff1a\"&nbsp;+ protocol +&nbsp;\":\/\/\"&nbsp;+ appName +&nbsp;\"\/\"&nbsp;+ streamName +&nbsp;\" \"&nbsp;+ status);<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; };<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; zlmApi.mk_events_listen(mkEvents);<\/code><code>&nbsp; &nbsp; }<\/code><code>}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u63a8\u62c9\u6d41\u6d4b\u8bd5\uff1a\u9a8c\u8bc1\u94fe\u8def\u901a\u7545<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u63a8\u6d41\u64cd\u4f5c\uff08\u57fa\u4e8e FFmpeg\uff09<\/h3>\n\n\n\n<p>\u4f7f\u7528 FFmpeg \u5de5\u5177\u5c06\u672c\u5730\u89c6\u9891\u6587\u4ef6\u63a8\u9001\u5230 RTSP \u670d\u52a1\u7aef\u53e3\uff0c\u540c\u65f6\u643a\u5e26\u9274\u6743 token\uff08\u9700\u4e0e\u9274\u6743\u903b\u8f91\u5339\u914d\uff09\u3002<br>\u6253\u5f00\u7ec8\u7aef\u6267\u884c\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># -re\uff1a\u6309\u89c6\u9891\u5b9e\u9645\u901f\u7387\u63a8\u6d41\uff1b-an\uff1a\u4e0d\u4f20\u8f93\u97f3\u9891\uff1b-c:v libx264\uff1a\u4f7f\u7528H.264\u89c6\u9891\u7f16\u7801<\/code><code>ffmpeg -re -an -i \/Users\/test\/videos\/demo.mp4 -c:v libx264 -f rtsp rtsp:\/\/127.0.0.1:9758\/live\/demo?token=stream2025<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u63a7\u5236\u53f0\u4e8b\u4ef6\u8f93\u51fa<\/h3>\n\n\n\n<p>\u63a8\u6d41\u6210\u529f\u540e\uff0c\u63a7\u5236\u53f0\u4f1a\u6253\u5370\u9274\u6743\u4fe1\u606f\u548c\u6d41\u4e0a\u7ebf\u901a\u77e5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>[Wed Sep 05 08:30:00 CST 2025] \u63a8\u6d41\u9274\u6743\u53c2\u6570\uff1atoken=stream2025<\/code><code>[Wed Sep 05 08:30:01 CST 2025] \u6d41\u72b6\u6001\u53d8\u5316\uff1artsp:\/\/live\/demo \u4e0a\u7ebf<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u64ad\u653e\u9a8c\u8bc1\uff08\u591a\u64ad\u653e\u5668\u652f\u6301\uff09<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>VLC \u64ad\u653e\u5668<\/strong>\u6253\u5f00 \u201c\u5a92\u4f53\u201d\u2192\u201c\u6253\u5f00\u7f51\u7edc\u4e32\u6d41\u201d\uff0c\u8f93\u5165 RTMP \u5730\u5740\u00a0<code>rtmp:\/\/127.0.0.1:9760\/live\/demo<\/code>\uff0c\u70b9\u51fb\u64ad\u653e\u5373\u53ef\u89c2\u770b\u3002<\/li>\n\n\n\n<li><strong>PotPlayer<\/strong>\u8f93\u5165 HTTP-FLV \u5730\u5740\u00a0<code>http:\/\/127.0.0.1:7789\/live\/demo.flv<\/code>\uff0c\u652f\u6301\u66f4\u4f4e\u5ef6\u8fdf\u64ad\u653e\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u524d\u7aef\u64ad\u653e\u9875\u9762\uff1a\u53ef\u89c6\u5316\u4ea4\u4e92<\/h2>\n\n\n\n<p>\u4e3a\u4e86\u8ba9\u4e1a\u52a1\u65b9\u66f4\u65b9\u4fbf\u5730\u4f7f\u7528\uff0c\u6211\u4eec\u57fa\u4e8e<strong>Thymeleaf+Bootstrap+flv.js<\/strong>\u5f00\u53d1\u524d\u7aef\u9875\u9762\uff0c\u652f\u6301\u6d4f\u89c8\u5668\u76f4\u63a5\u64ad\u653e\u89c6\u9891\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e00\u6b65\uff1a\u7f16\u5199\u63a7\u5236\u5668\uff08\u8df3\u8f6c\u9875\u9762\uff09<\/h3>\n\n\n\n<p>\u521b\u5efa<code>StreamPlayerController<\/code>\uff0c\u4f20\u9012\u89c6\u9891\u64ad\u653e\u5730\u5740\u5230\u524d\u7aef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>package&nbsp;com.stream.controller;<\/code><code>import&nbsp;org.springframework.stereotype.Controller;<\/code><code>import&nbsp;org.springframework.ui.Model;<\/code><code>import&nbsp;org.springframework.web.bind.annotation.GetMapping;<\/code><code>@Controller<\/code><code>public&nbsp;class&nbsp;StreamPlayerController&nbsp;{<\/code><code>&nbsp; &nbsp;&nbsp;\/**<\/code><code>&nbsp; &nbsp; &nbsp;* \u8df3\u8f6c\u89c6\u9891\u64ad\u653e\u9875\u9762<\/code><code>&nbsp; &nbsp; &nbsp;*\/<\/code><code>&nbsp; &nbsp;&nbsp;@GetMapping(\"\/stream\/player\")<\/code><code>&nbsp; &nbsp;&nbsp;public&nbsp;String toPlayerPage(Model model) {<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u4f20\u9012HTTP-FLV\u64ad\u653e\u5730\u5740\uff08\u6d4f\u89c8\u5668\u517c\u5bb9\u6027\u66f4\u597d\uff09<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; String flvUrl =&nbsp;\"http:\/\/127.0.0.1:7789\/live\/demo.flv\";<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; model.addAttribute(\"videoUrl\", flvUrl);<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;\"stream-player\";<\/code><code>&nbsp; &nbsp; }<\/code><code>}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u7b2c\u4e8c\u6b65\uff1a\u5f00\u53d1\u524d\u7aef\u9875\u9762\uff08stream-player.html\uff09<\/h3>\n\n\n\n<p>\u9875\u9762\u91c7\u7528 Bootstrap \u7f8e\u5316\u5e03\u5c40\uff0c\u4f7f\u7528 flv.js \u5904\u7406 FLV \u683c\u5f0f\u89c6\u9891\uff0c\u540c\u65f6\u589e\u52a0\u64ad\u653e\u72b6\u6001\u63d0\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;!DOCTYPE&nbsp;html&gt;<\/code><code>&lt;html&nbsp;xmlns:th=\"http:\/\/www.thymeleaf.org\"&gt;<\/code><code>&lt;head&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;meta&nbsp;charset=\"UTF-8\"&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;title&gt;\u5b9e\u65f6\u89c6\u9891\u64ad\u653e\u5e73\u53f0&lt;\/title&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;!-- \u5f15\u5165Bootstrap\u6837\u5f0f --&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;link&nbsp;href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.3.3\/dist\/css\/bootstrap.min.css\"&nbsp;rel=\"stylesheet\"&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;!-- \u5f15\u5165flv.js\uff1a\u5904\u7406FLV\u89c6\u9891\u6d41 --&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;script&nbsp;src=\"https:\/\/cdn.jsdelivr.net\/npm\/flv.js\/dist\/flv.min.js\"&gt;&lt;\/script&gt;<\/code><code>&lt;\/head&gt;<\/code><code>&lt;body&nbsp;class=\"bg-gray-100\"&gt;<\/code><code>&lt;div&nbsp;class=\"container mt-6\"&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;!-- \u9875\u9762\u6807\u9898 --&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;div&nbsp;class=\"text-center mb-5\"&gt;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;h2&nbsp;class=\"text-primary\"&gt;\u5b9e\u65f6\u89c6\u9891\u64ad\u653e&lt;\/h2&gt;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;p&nbsp;class=\"text-muted\"&nbsp;id=\"playStatus\"&gt;\u7b49\u5f85\u63a8\u6d41\u8fde\u63a5...&lt;\/p&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;\/div&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;!-- \u89c6\u9891\u64ad\u653e\u533a\u57df --&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;div&nbsp;class=\"card shadow rounded-4\"&gt;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;div&nbsp;class=\"card-body p-0\"&gt;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;video&nbsp;id=\"streamPlayer\"&nbsp;class=\"w-100 rounded-top-4\"&nbsp;controls&nbsp;autoplay&gt;&lt;\/video&gt;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;div&nbsp;class=\"p-3 bg-light\"&gt;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;p&nbsp;class=\"mb-0\"&gt;&lt;span&nbsp;class=\"fw-bold\"&gt;\u64ad\u653e\u5730\u5740\uff1a&lt;\/span&gt;&lt;span&nbsp;th:text=\"${videoUrl}\"&gt;&lt;\/span&gt;&lt;\/p&gt;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;\/div&gt;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;\/div&gt;<\/code><code>&nbsp; &nbsp;&nbsp;&lt;\/div&gt;<\/code><code>&lt;\/div&gt;<\/code><code>&lt;script&nbsp;th:inline=\"javascript\"&gt;<\/code><code>&nbsp; &nbsp;&nbsp;\/\/ \u83b7\u53d6\u540e\u7aef\u4f20\u9012\u7684\u89c6\u9891\u5730\u5740<\/code><code>&nbsp; &nbsp;&nbsp;const&nbsp;videoUrl = [[${videoUrl}]];<\/code><code>&nbsp; &nbsp;&nbsp;const&nbsp;videoElement =&nbsp;document.getElementById('streamPlayer');<\/code><code>&nbsp; &nbsp;&nbsp;const&nbsp;statusElement =&nbsp;document.getElementById('playStatus');<\/code><code>&nbsp; &nbsp;&nbsp;\/\/ \u521d\u59cb\u5316flv\u64ad\u653e\u5668<\/code><code>&nbsp; &nbsp;&nbsp;if&nbsp;(flvjs.isSupported()) {<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;const&nbsp;flvPlayer = flvjs.createPlayer({<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;type:&nbsp;'flv',<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;url: videoUrl,<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;isLive:&nbsp;true&nbsp;\/\/ \u6807\u8bb0\u4e3a\u76f4\u64ad\u6d41\uff0c\u4f18\u5316\u5ef6\u8fdf<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; });<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u7ed1\u5b9a\u89c6\u9891\u5143\u7d20<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; flvPlayer.attachMediaElement(videoElement);<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u52a0\u8f7d\u5e76\u64ad\u653e<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; flvPlayer.load();<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; flvPlayer.play().then(() =&gt;&nbsp;{<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; statusElement.textContent&nbsp;=&nbsp;\"\u64ad\u653e\u4e2d\uff08\u4f4e\u5ef6\u8fdf\u6a21\u5f0f\uff09\";<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; statusElement.className&nbsp;=&nbsp;\"text-success fw-medium\";<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; }).catch(error&nbsp;=&gt;&nbsp;{<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; statusElement.textContent&nbsp;=&nbsp;\"\u64ad\u653e\u5931\u8d25\uff1a\"&nbsp;+ error.message;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; statusElement.className&nbsp;=&nbsp;\"text-danger\";<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; });<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u76d1\u542c\u64ad\u653e\u9519\u8bef<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; flvPlayer.on('error',&nbsp;(err) =&gt;&nbsp;{<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; statusElement.textContent&nbsp;=&nbsp;\"\u64ad\u653e\u5f02\u5e38\uff1a\"&nbsp;+ err;<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; statusElement.className&nbsp;=&nbsp;\"text-danger\";<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; });<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\/\/ \u76d1\u542c\u6d41\u65ad\u5f00<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; flvPlayer.on('stats',&nbsp;(stats) =&gt;&nbsp;{<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(stats.bufferedLength&nbsp;===&nbsp;0&nbsp;&amp;&amp; !flvPlayer.isPlaying()) {<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; statusElement.textContent&nbsp;=&nbsp;\"\u6d41\u5df2\u65ad\u5f00\uff0c\u8bf7\u68c0\u67e5\u63a8\u6d41\u670d\u52a1\";<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; statusElement.className&nbsp;=&nbsp;\"text-warning\";<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; });<\/code><code>&nbsp; &nbsp; }&nbsp;else&nbsp;{<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; statusElement.textContent&nbsp;=&nbsp;\"\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301FLV\u64ad\u653e\uff0c\u8bf7\u66f4\u6362Chrome\/Firefox\";<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; statusElement.className&nbsp;=&nbsp;\"text-danger\";<\/code><code>&nbsp; &nbsp; }<\/code><code>&lt;\/script&gt;<\/code><code>&lt;\/body&gt;<\/code><code>&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u8bbf\u95ee\u9875\u9762<\/h3>\n\n\n\n<p>\u542f\u52a8SpringBoot \u9879\u76ee\u540e\uff0c\u5728\u6d4f\u89c8\u5668\u8f93\u5165<\/p>\n\n\n\n<p><code>http:\/\/127.0.0.1:8080\/stream\/player<\/code>\uff0c\u5373\u53ef\u770b\u5230\u89c6\u9891\u64ad\u653e\u9875\u9762 \u2014\u2014 \u63a8\u6d41\u6b63\u5e38\u65f6\u4f1a\u81ea\u52a8\u64ad\u653e\uff0c\u540c\u65f6\u663e\u793a\u5b9e\u65f6\u72b6\u6001\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7cfb\u7edf\u603b\u7ed3\u4e0e\u6269\u5c55\u65b9\u5411<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u6838\u5fc3\u4f18\u52bf<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u540e\u7aef\u8f7b\u91cf\u9ad8\u6548<\/strong>\u57fa\u4e8e Zlm4j \u5c01\u88c5\uff0c\u65e0\u9700\u5173\u6ce8\u5e95\u5c42\u534f\u8bae\uff0c\u51e0\u884c\u914d\u7f6e\u5373\u53ef\u542f\u52a8\u591a\u534f\u8bae\u670d\u52a1\uff1b<\/li>\n\n\n\n<li><strong>\u5b89\u5168\u53ef\u63a7<\/strong>\u652f\u6301\u63a8\u6d41\u9274\u6743\uff0c\u9632\u6b62\u975e\u6cd5\u63a5\u5165\uff1b\u6d41\u72b6\u6001\u76d1\u63a7\u4fbf\u4e8e\u95ee\u9898\u6392\u67e5\uff1b<\/li>\n\n\n\n<li><strong>\u524d\u7aef\u6613\u7528<\/strong>\u6d4f\u89c8\u5668\u76f4\u63a5\u64ad\u653e\uff0c\u65e0\u9700\u5b89\u88c5\u989d\u5916\u63d2\u4ef6\uff0c\u9002\u914d\u4e3b\u6d41\u6d4f\u89c8\u5668\uff1b<\/li>\n\n\n\n<li><strong>\u517c\u5bb9\u6027\u5f3a<\/strong>\u652f\u6301 RTSP\/RTMP\/HTTP-FLV\/HLS \u7b49\u591a\u79cd\u534f\u8bae\uff0c\u53ef\u5bf9\u63a5\u6444\u50cf\u5934\u3001\u76f4\u64ad\u8f6f\u4ef6\u7b49\u4e0d\u540c\u8bbe\u5907\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u6269\u5c55\u65b9\u5411<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u89c6\u9891\u5f55\u5236<\/strong>\u96c6\u6210 ZLMediaKit \u7684\u5f55\u5236\u63a5\u53e3\uff0c\u5b9e\u73b0 \u201c\u63a8\u6d41\u5373\u5f55\u5236\u201d\uff0c\u652f\u6301\u6309\u65f6\u95f4\u5207\u7247\u5b58\u50a8\uff1b<\/li>\n\n\n\n<li><strong>\u591a\u623f\u95f4\u7ba1\u7406<\/strong>\u57fa\u4e8e Redis \u5b58\u50a8\u6d41\u4fe1\u606f\uff0c\u5b9e\u73b0\u591a\u7528\u6237\u540c\u65f6\u89c2\u770b\u4e0d\u540c\u6d41\uff0c\u652f\u6301\u623f\u95f4\u6743\u9650\u63a7\u5236\uff1b<\/li>\n\n\n\n<li><strong>\u8f6c\u7801\u529f\u80fd<\/strong>\u6dfb\u52a0 FFmpeg \u8f6c\u7801\u670d\u52a1\uff0c\u81ea\u52a8\u5c06\u89c6\u9891\u8f6c\u4e3a\u591a\u79cd\u5206\u8fa8\u7387\uff08\u5982 720P\/480P\uff09\uff0c\u9002\u914d\u4e0d\u540c\u7f51\u7edc\u73af\u5883\uff1b<\/li>\n\n\n\n<li><strong>\u544a\u8b66\u901a\u77e5<\/strong>\u5bf9\u6d41\u65ad\u5f00\u3001\u63a8\u6d41\u8d85\u65f6\u7b49\u5f02\u5e38\u60c5\u51b5\uff0c\u901a\u8fc7\u77ed\u4fe1 \/ \u90ae\u4ef6\u53d1\u9001\u544a\u8b66\uff0c\u63d0\u5347\u8fd0\u7ef4\u6548\u7387<\/li>\n<\/ul>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u5728\u667a\u6167\u5b89\u9632\u3001\u5728\u7ebf\u6559\u80b2\u76f4\u64ad\u3001\u6237\u5916\u8bbe\u5907\u5b9e\u65f6\u56de\u4f20\u7b49\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u89c6\u9891\u63a8\u62c9\u6d41\u662f\u6838\u5fc3\u57fa\u7840\u80fd\u529b\u3002\u6700\u521d\u6211\u5c1d\u8bd5\u57fa\u4e8e Netty \u624b\u52a8\u5c01\u88c5 RTSP  &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[47,7],"tags":[],"class_list":["post-6669","post","type-post","status-publish","format-standard","hentry","category-ffmpeg","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-scaled.png","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-scaled.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-scaled.png","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-scaled.png","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-scaled.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-scaled.png","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-scaled.png","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-scaled.png","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-1024x166.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044216445-1024x166.png","id":"image1"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"ffmpeg","post_date":"2025-09-29","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":427,"next_post_id":6685,"next_post_title":"\u57fa\u4e8e SpringBoot3.x \u4e0e OCR \u6784\u5efa\u7684\u533b\u7597\u8f85\u52a9\u7cfb\u7edf\u5b9e\u6218","previous_post_id":6659,"previous_post_title":"SpringBoot+WebSocket\u6253\u9020\u8d85\u7a33\u5b9a\u5b9e\u65f6\u76d1\u63a7\uff01","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=6669"}],"version-history":[{"count":2,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6669\/revisions"}],"predecessor-version":[{"id":6672,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6669\/revisions\/6672"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=6669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=6669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=6669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}