{"id":6680,"date":"2025-09-29T12:47:48","date_gmt":"2025-09-29T04:47:48","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=6680"},"modified":"2025-09-29T12:47:57","modified_gmt":"2025-09-29T04:47:57","slug":"%e4%ba%8e%e6%b5%b7%e5%ba%b7sdk%e7%9a%84c%e5%ae%9e%e6%97%b6%e8%a7%86%e9%a2%91%e6%b5%81%e9%80%90%e5%b8%a7%e6%8a%93%e5%8f%96%e5%ad%98%e5%9b%be%e5%b0%8f%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/c\/%e4%ba%8e%e6%b5%b7%e5%ba%b7sdk%e7%9a%84c%e5%ae%9e%e6%97%b6%e8%a7%86%e9%a2%91%e6%b5%81%e9%80%90%e5%b8%a7%e6%8a%93%e5%8f%96%e5%ad%98%e5%9b%be%e5%b0%8f%e5%b7%a5%e5%85%b7\/","title":{"rendered":"\u4e8e\u6d77\u5eb7SDK\u7684C++\u5b9e\u65f6\u89c6\u9891\u6d41\u9010\u5e27\u6293\u53d6\u5b58\u56fe\u5c0f\u5de5\u5177"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>\u6548\u679c<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"519\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" alt=\"\" class=\"wp-image-6681 lazyload\" srcset=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png 993w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911-300x157.png 300w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911-768x401.png 768w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"519\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png\" alt=\"\" class=\"wp-image-6681\" srcset=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png 993w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911-300x157.png 300w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911-768x401.png 768w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><\/noscript><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u9879\u76ee<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-1024x576.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" alt=\"\" class=\"wp-image-6682 lazyload\" srcset=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-1024x576.png 1024w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-300x169.png 300w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-768x432.png 768w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835.png 1496w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-1024x576.png\" alt=\"\" class=\"wp-image-6682\" srcset=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-1024x576.png 1024w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-300x169.png 300w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-768x432.png 768w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835.png 1496w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/noscript><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4f7f\u7528<\/strong><strong><\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"723\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044744600.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" alt=\"\" class=\"wp-image-6683 lazyload\" srcset=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044744600.png 756w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044744600-300x287.png 300w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"723\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044744600.png\" alt=\"\" class=\"wp-image-6683\" srcset=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044744600.png 756w, https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044744600-300x287.png 300w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><\/noscript><\/figure>\n\n\n\n<p>Usage: PlayDemo.exe &lt;IP&gt; &lt;Port&gt; &lt;Username&gt; &lt;Password&gt;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4ee3\u7801<\/strong><strong><\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#define<\/a>&nbsp;_CRT_SECURE_NO_WARNINGS<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;stdio.h&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;string&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;iostream&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;Windows.h&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;thread&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;time.h&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;conio.h&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;filesystem&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;iomanip&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;chrono&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;sstream&gt;<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;&lt;direct.h&gt;<\/em><br><br>using namespace std;<br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;\"PlayM4.h\"<\/em><br><em><a href=\"javascript:;\" target=\"_blank\"  rel=\"nofollow\" >#include<\/a>&nbsp;\"HCNetSDK.h\"<\/em><br><br>int&nbsp;times&nbsp;= 0;<br>LONG lRealPlayHandle;<br>LONG m_lPort&#91;16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };\/\/\u5168\u5c40\u7684\u64ad\u653e\u5e93port\u53f7<br><br>std::string imgFolder =&nbsp;\"img\"; \/\/ \u56fe\u7247\u4fdd\u5b58\u6587\u4ef6\u5939<br><br>\/\/\u64ad\u653e\u5e93\u786c\u89e3\u7801\u56de\u8c03<br>void CALLBACK DisplayCBFun(DISPLAY_INFO_YUV* pstDisplayInfo) {<br><br>&nbsp;\/\/\u6bcf100\u6b21\u4fdd\u5b58\u4e00\u6b21yuv\u6570\u636e<br>if&nbsp;(times&nbsp;% 100 == 0) {<br>&nbsp; FILE* fp = NULL;<br>&nbsp; string ansiString =&nbsp;\"example\"&nbsp;+ to_string(pstDisplayInfo-&gt;nPort) +&nbsp;\"___\"&nbsp;+ to_string(times&nbsp;\/ 100) +&nbsp;\".yuv\";<br>&nbsp; fp = fopen(ansiString.c_str(),&nbsp;\"wb\");<br>&nbsp; \/\/ \u5c06\u5b57\u7b26\u6570\u7ec4\u5199\u5165\u6587\u4ef6<br>&nbsp; fwrite(pstDisplayInfo-&gt;pBuf, sizeof(char), pstDisplayInfo-&gt;nBufLen, fp); \/\/ \u4e0d\u5305\u62ec\u672b\u5c3e\u7684\u7a7a\u5b57\u7b26<br>&nbsp; \/\/ \u5173\u95ed\u6587\u4ef6<br>&nbsp; fclose(fp);<br>&nbsp;}<br>times++;<br>printf(\"Buf\u957f\u5ea6:%d\\n\u753b\u9762\u5bbd:%d\\n\u753b\u9762\u9ad8:%d\\n\u6570\u636e\u7c7b\u578b:%d\\nn\u64ad\u653e\u5e93\u53e5\u67c4:%d\\n\", pstDisplayInfo-&gt;nBufLen, pstDisplayInfo-&gt;nWidth, pstDisplayInfo-&gt;nHeight, pstDisplayInfo-&gt;nType, pstDisplayInfo-&gt;nPort);<br>}<br><br>\/\/\u64ad\u653e\u5e93\u89e3\u7801\u56de\u8c03<br>void CALLBACK DecCBFunIm(long nPort, char* pBuf, long nSize, FRAME_INFO* pFrameInfo, void* nUser, void* nReserved2) {<br><br>&nbsp;\/\/ \u83b7\u53d6\u5f53\u524d\u65f6\u95f4\uff08\u7cbe\u786e\u5230\u6beb\u79d2\uff09<br>&nbsp;auto now = std::chrono::system_clock::now();<br>&nbsp;auto now_ms = std::chrono::time_point_cast&lt;std::chrono::milliseconds&gt;(now);<br>&nbsp;auto epoch = now_ms.time_since_epoch();<br>&nbsp;auto value = std::chrono::duration_cast&lt;std::chrono::milliseconds&gt;(epoch);<br>&nbsp;long long milliseconds = value.count();<br><br>&nbsp;\/\/ \u8f6c\u6362\u4e3a\u65f6\u95f4\u7ed3\u6784<br>&nbsp;std::time_t time = std::chrono::system_clock::to_time_t(now);<br>&nbsp;std::tm tm = *std::localtime(&amp;time);<br><br>&nbsp;\/\/ \u683c\u5f0f\u5316\u65f6\u95f4\u5b57\u7b26\u4e32<br>&nbsp;std::ostringstream oss;<br>&nbsp;oss &lt;&lt; std::put_time(&amp;tm,&nbsp;\"%Y%m%d_%H%M%S_\") &lt;&lt; std::setfill('0') &lt;&lt; std::setw(3) &lt;&lt; (milliseconds % 1000);<br>&nbsp;std::string baseName = imgFolder +&nbsp;\"\/\"&nbsp;+ oss.str();<br><br>&nbsp;\/\/ \u4fdd\u5b58JPEG\u56fe\u7247\u5e76\u8ba1\u7b97\u8017\u65f6<br>&nbsp;auto jpgStart = std::chrono::high_resolution_clock::now();<br>&nbsp;std::string jpgPath = baseName +&nbsp;\".jpg\";<br>&nbsp;BOOL jpgResult = PlayM4_ConvertToJpegFile(pBuf, nSize, pFrameInfo-&gt;nWidth, pFrameInfo-&gt;nHeight, pFrameInfo-&gt;nType, const_cast&lt;char*&gt;(jpgPath.c_str()));<br>&nbsp;auto jpgEnd = std::chrono::high_resolution_clock::now();<br>&nbsp;auto jpgDuration = std::chrono::duration_cast&lt;std::chrono::milliseconds&gt;(jpgEnd - jpgStart);<br><br>&nbsp;\/\/ \u4fdd\u5b58BMP\u56fe\u7247\u5e76\u8ba1\u7b97\u8017\u65f6<br>&nbsp;\/\/auto bmpStart = std::chrono::high_resolution_clock::now();<br>&nbsp;\/\/std::string bmpPath = baseName +&nbsp;\".bmp\";<br>&nbsp;\/\/BOOL bmpResult = PlayM4_ConvertToBmpFile(pBuf, nSize, pFrameInfo-&gt;nWidth, pFrameInfo-&gt;nHeight, pFrameInfo-&gt;nType, const_cast&lt;char*&gt;(bmpPath.c_str()));<br>&nbsp;\/\/auto bmpEnd = std::chrono::high_resolution_clock::now();<br>&nbsp;\/\/auto bmpDuration = std::chrono::duration_cast&lt;std::chrono::milliseconds&gt;(bmpEnd - bmpStart);<br><br>&nbsp;\/\/ \u8f93\u51fa\u4fdd\u5b58\u7ed3\u679c\u548c\u65f6\u95f4<br>if&nbsp;(jpgResult) {<br>&nbsp; std::cout &lt;&lt;&nbsp;\"JPEG saved: \"&nbsp;&lt;&lt; jpgPath &lt;&lt;&nbsp;\" (Size: \"&nbsp;&lt;&lt; nSize &lt;&lt;&nbsp;\" bytes, \"&nbsp;&lt;&lt; pFrameInfo-&gt;nWidth &lt;&lt;&nbsp;\"x\"&nbsp;&lt;&lt; pFrameInfo-&gt;nHeight &lt;&lt;&nbsp;\")\"&nbsp;&lt;&lt;&nbsp;\" \u8017\u65f6: \"&nbsp;&lt;&lt; jpgDuration.count() &lt;&lt;&nbsp;\" ms\"&nbsp;&lt;&lt; std::endl;<br>&nbsp;}<br>else&nbsp;{<br>&nbsp; std::cout &lt;&lt;&nbsp;\"Failed to save JPEG. Error code: \"&nbsp;&lt;&lt; GetLastError() &lt;&lt; std::endl;<br>&nbsp;}<br><br>&nbsp;\/\/if&nbsp;(bmpResult) {<br>&nbsp;\/\/ std::cout &lt;&lt;&nbsp;\"BMP saved: \"&nbsp;&lt;&lt; bmpPath &lt;&lt;&nbsp;\" in \"&nbsp;&lt;&lt; bmpDuration.count() &lt;&lt;&nbsp;\" ms\"&nbsp;&lt;&lt; std::endl;<br>&nbsp;\/\/}<br>&nbsp;\/\/else&nbsp;{<br>&nbsp;\/\/ std::cout &lt;&lt;&nbsp;\"Failed to save BMP. Error code: \"&nbsp;&lt;&lt; GetLastError() &lt;&lt; std::endl;<br>&nbsp;\/\/}<br><br>&nbsp;\/\/\/\/ \u8f93\u51fa\u603b\u8017\u65f6<br>&nbsp;\/\/auto totalDuration = std::chrono::duration_cast&lt;std::chrono::milliseconds&gt;(bmpEnd - jpgStart);<br>&nbsp;\/\/std::cout &lt;&lt;&nbsp;\"Total time for both images: \"&nbsp;&lt;&lt; totalDuration.count() &lt;&lt;&nbsp;\" ms\"&nbsp;&lt;&lt; std::endl;<br><br>}<br><br>\/\/sdk\u7801\u6d41\u56de\u8c03<br>void CALLBACK g_RealDataCallBack_V30(LONG lRealHandle, DWORD dwDataType, BYTE* pBuffer, DWORD dwBufSize, void* dwUser)<br>{<br>&nbsp;DWORD dRet = 0;<br>&nbsp;BOOL inData = FALSE;<br>&nbsp;LONG lPort = -1;<br>&nbsp;switch (dwDataType)<br>&nbsp;{<br>case&nbsp;NET_DVR_SYSHEAD: \/\/\u7cfb\u7edf\u5934<br><br>if&nbsp;(!PlayM4_GetPort(&amp;lPort)) &nbsp;\/\/\u83b7\u53d6\u64ad\u653e\u5e93\u672a\u4f7f\u7528\u7684\u901a\u9053\u53f7<br>&nbsp; {<br>&nbsp; &nbsp;printf(\"\u7533\u8bf7\u64ad\u653e\u5e93\u8d44\u6e90\u5931\u8d25\");<br>&nbsp; &nbsp;break;<br>&nbsp; }<br>printf(\"\u64ad\u653e\u5e93\u53e5\u67c4\uff1a%d\\n\", lPort);<br>&nbsp; m_lPort&#91;lRealPlayHandle] = lPort; \/\/\u7b2c\u4e00\u6b21\u56de\u8c03\u7684\u662f\u7cfb\u7edf\u5934\uff0c\u5c06\u83b7\u53d6\u7684\u64ad\u653e\u5e93port\u53f7\u8d4b\u503c\u7ed9\u5168\u5c40port\uff0c\u4e0b\u6b21\u56de\u8c03\u6570\u636e\u65f6\u5373\u4f7f\u7528\u6b64port\u53f7\u64ad\u653e<br><br>if&nbsp;(dwBufSize &gt; 0) {<br><br>&nbsp; &nbsp;\/\/\u8bbe\u7f6e\u5b9e\u65f6\u6d41\u64ad\u653e\u6a21\u5f0f<br>&nbsp; &nbsp;if&nbsp;(!PlayM4_SetStreamOpenMode(m_lPort&#91;lRealPlayHandle], STREAME_REALTIME))<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;printf(\"PlayM4_SetStreamOpenMode Error\\n\");<br>&nbsp; &nbsp;&nbsp;printf(\"GetLastError\u9519\u8bef\u7801 :%d\\n\", PlayM4_GetLastError(m_lPort&#91;lRealPlayHandle]));<br>&nbsp; &nbsp;&nbsp;break;<br>&nbsp; &nbsp;}<br>&nbsp; &nbsp;else<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;printf(\"PlayM4_SetStreamOpenMode Sus!\\n\");<br>&nbsp; &nbsp;}<br>&nbsp; &nbsp;\/\/\u6253\u5f00\u6d41\u63a5\u53e3<br>&nbsp; &nbsp;if&nbsp;(!PlayM4_OpenStream(m_lPort&#91;lRealPlayHandle], pBuffer, dwBufSize, 5 * 1024 * 1024))<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;printf(\"PlayM4_OpenStream Error\\n\");<br>&nbsp; &nbsp;&nbsp;printf(\"GetLastError\u9519\u8bef\u7801 :%d\\n\", PlayM4_GetLastError(m_lPort&#91;lRealPlayHandle]));<br>&nbsp; &nbsp;&nbsp;break;<br>&nbsp; &nbsp;}<br>&nbsp; &nbsp;else<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;printf(\"PlayM4_OpenStream Sus!\\n\");<br>&nbsp; &nbsp;}<br><br><br>&nbsp; &nbsp;\/\/\u8bbe\u7f6e\u89e3\u7801\u6a21\u5f0f\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u65700\u4e3a\u8f6f\u89e3\u7801\uff0c1\u4e3a\u786c\u89e3\u7801\uff08\u786c\u89e3\u7801\u9700\u8981\u786c\u4ef6\u652f\u6301\uff09<br>&nbsp; &nbsp;\/\/if&nbsp;(!PlayM4_SetDecodeEngine(m_lPort&#91;lRealPlayHandle], 1))<br>&nbsp; &nbsp;\/\/{<br>&nbsp; &nbsp;\/\/&nbsp;printf(\"PlayM4_SetDecodeEngine Error\\n\");<br>&nbsp; &nbsp;\/\/&nbsp;printf(\"GetLastError\u9519\u8bef\u7801 :%d\\n\", PlayM4_GetLastError(m_lPort&#91;lRealPlayHandle]));<br>&nbsp; &nbsp;\/\/&nbsp;break;<br>&nbsp; &nbsp;\/\/}<br>&nbsp; &nbsp;\/\/else<br>&nbsp; &nbsp;\/\/{<br>&nbsp; &nbsp;\/\/&nbsp;printf(\"PlayM4_SetDecodeEngine Sus!\\n\");<br>&nbsp; &nbsp;\/\/}<br>&nbsp; &nbsp;\/\/\/\/\u8bbe\u7f6e\u786c\u89e3\u7801\u56de\u8c03\uff0c\u82e5\u8bbe\u7f6e\u4e3a\u786c\u89e3\u7801\u6a21\u5f0f\uff0c\u9700\u8981\u4f7f\u7528\u8be5\u63a5\u53e3\u8bbe\u7f6e\u786c\u89e3\u7801\u56de\u8c03<br>&nbsp; &nbsp;\/\/if&nbsp;(!PlayM4_SetDisplayCallBackYUV(m_lPort&#91;lRealPlayHandle], DisplayCBFun, FALSE, NULL))<br>&nbsp; &nbsp;\/\/{<br>&nbsp; &nbsp;\/\/&nbsp;printf(\"PlayM4_SetDisplayCallBackYUV Error\\n\");<br>&nbsp; &nbsp;\/\/&nbsp;printf(\"GetLastError\u9519\u8bef\u7801 :%d\\n\", PlayM4_GetLastError(m_lPort&#91;lRealPlayHandle]));<br>&nbsp; &nbsp;\/\/&nbsp;break;<br>&nbsp; &nbsp;\/\/}<br>&nbsp; &nbsp;\/\/else<br>&nbsp; &nbsp;\/\/{<br>&nbsp; &nbsp;\/\/&nbsp;printf(\"PlayM4_SetDecodeEngine Sus!\\n\");<br>&nbsp; &nbsp;\/\/}<br><br>&nbsp; &nbsp;\/\/\u8bbe\u7f6e\u89e3\u7801\u56de\u8c03\u51fd\u6570 \u89e3\u7801\u663e\u793a \u56de\u8c03yuv\u6570\u636e\uff0c\u8f6f\u89e3\u6a21\u5f0f\u4e0b\uff0c\u4f7f\u7528\u8be5\u56de\u8c03 &nbsp;&nbsp;<br>&nbsp; &nbsp;if&nbsp;(!PlayM4_SetDecCallBackExMend(m_lPort&#91;lRealPlayHandle], DecCBFunIm, NULL, 0, NULL))<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;printf(\"PlayM4_SetDecCallBackExMend Error\\n\");<br>&nbsp; &nbsp;&nbsp;printf(\"GetLastError\u9519\u8bef\u7801 :%d\\n\", PlayM4_GetLastError(m_lPort&#91;lRealPlayHandle]));<br>&nbsp; &nbsp;&nbsp;break;<br>&nbsp; &nbsp;}<br>&nbsp; &nbsp;else<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;printf(\"PlayM4_SetDecodeEngine Sus!\\n\");<br>&nbsp; &nbsp;}<br><br>&nbsp; &nbsp;if&nbsp;(!PlayM4_Play(m_lPort&#91;lRealPlayHandle], NULL)) \/\/\u64ad\u653e\u5f00\u59cbhWnd&#91;lRealHandle]<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;printf(\"PlayM4_Play Error\\n\");<br>&nbsp; &nbsp;&nbsp;printf(\"GetLastError\u9519\u8bef\u7801 :%d\\n\", PlayM4_GetLastError(m_lPort&#91;lRealPlayHandle]));<br>&nbsp; &nbsp;&nbsp;break;<br>&nbsp; &nbsp;}<br>&nbsp; &nbsp;else<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;printf(\"PlayM4_SetDecodeEngine Sus!\\n\");<br>&nbsp; &nbsp;}<br>&nbsp; }<br>break;<br>case&nbsp;NET_DVR_STREAMDATA: &nbsp; \/\/\u7801\u6d41\u6570\u636e<br>if&nbsp;(dwBufSize &gt; 0 &amp;&amp; m_lPort&#91;lRealPlayHandle] != -1)<br>&nbsp; {<br>&nbsp; &nbsp;\/\/\u9001\u6570\u636e\u5165\u64ad\u653e\u5e93<br>&nbsp; &nbsp;while&nbsp;(!PlayM4_InputData(m_lPort&#91;lRealPlayHandle], pBuffer, dwBufSize))<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp; int dwError = PlayM4_GetLastError(m_lPort&#91;lRealPlayHandle]);<br>&nbsp; &nbsp;&nbsp;printf(\"\u64ad\u653e\u5e93\u53e5\u67c4ID\uff1a%d,\u9519\u8bef\u7801\uff1a%d\\n\", m_lPort&#91;lRealPlayHandle], dwError);<br>&nbsp; &nbsp;&nbsp;if&nbsp;(dwError == 11) &nbsp;\/\/\u7f13\u51b2\u533a\u6ee1\uff0c\u9700\u8981\u91cd\u590d\u9001\u5165\u6570\u636e<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp;continue;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp;}<br>&nbsp; }<br>break;<br>&nbsp;default: \/\/\u5176\u4ed6\u6570\u636e<br>if&nbsp;(dwBufSize &gt; 0 &amp;&amp; m_lPort&#91;lRealPlayHandle] != -1)<br>&nbsp; {<br>&nbsp; &nbsp;if&nbsp;(!PlayM4_InputData(m_lPort&#91;lRealPlayHandle], pBuffer, dwBufSize))<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;break;<br>&nbsp; &nbsp;}<br>&nbsp; }<br>break;<br>&nbsp;}<br><br>}<br>\/\/\u64ad\u653e\u5e93\u6293\u56fe<br>void&nbsp;getPic() {<br>&nbsp;int i = 0;<br>&nbsp;BOOL &nbsp; bFlag = FALSE;<br>&nbsp;DWORD &nbsp;dwErr = 0;<br>&nbsp;LONG dwWidth = 0;<br>&nbsp;LONG dwHeight = 0;<br>&nbsp;DWORD dwSize = 0;<br>&nbsp;DWORD dwCapSize = 0;<br><br>&nbsp;\/\/\u629310\u5f20\u56fe<br>while&nbsp;(i++ &lt; 10) {<br><br>&nbsp; \/\/\u83b7\u53d6\u5f53\u524d\u89c6\u9891\u6587\u4ef6\u7684\u5206\u8fa8\u7387<br>&nbsp; int bFlag = PlayM4_GetPictureSize(m_lPort&#91;lRealPlayHandle], &amp;dwWidth, &amp;dwHeight);<br>if&nbsp;(bFlag == FALSE)<br>&nbsp; {<br>&nbsp; &nbsp;dwErr = PlayM4_GetLastError(m_lPort&#91;lRealPlayHandle]);<br>&nbsp; &nbsp;printf(\"PlayM4_GetPictureSize, error code: %d\\n\", dwErr);<br>&nbsp; &nbsp;break;<br>&nbsp; }<br>&nbsp; dwSize = dwWidth * dwHeight * 5;<br>&nbsp; \/\/\u7533\u8bf7\u6293\u56fe\u5185\u5b58<br>&nbsp; BYTE* m_pCapBuf = NULL;<br>if&nbsp;(m_pCapBuf == NULL)<br>&nbsp; {<br>&nbsp; &nbsp;m_pCapBuf = new BYTE&#91;dwSize];<br>&nbsp; &nbsp;if&nbsp;(m_pCapBuf == NULL)<br>&nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp;return;<br>&nbsp; &nbsp;}<br>&nbsp; }<br><br>&nbsp; \/\/\u6293\u56feBMP\u56fe\u7247<br>&nbsp; bFlag = PlayM4_GetJPEG(m_lPort&#91;lRealPlayHandle], m_pCapBuf, dwSize, &amp;dwCapSize);<br>if&nbsp;(bFlag == FALSE)<br>&nbsp; {<br>&nbsp; &nbsp;dwErr = PlayM4_GetLastError(m_lPort&#91;lRealPlayHandle]);<br>&nbsp; &nbsp;printf(\"PlayM4_GetLastError, error code: %d\\n\", dwErr);<br>&nbsp; &nbsp;break;<br>&nbsp; }<br>if&nbsp;(bFlag) {<br>&nbsp; &nbsp;FILE* fp = NULL;<br>&nbsp; &nbsp;time_t timep;<br>&nbsp; &nbsp;time(&amp;timep); \/\/\u83b7\u53d6\u4ece1970\u81f3\u4eca\u8fc7\u4e86\u591a\u5c11\u79d2\uff0c\u5b58\u5165time_t\u7c7b\u578b\u7684timep<br>&nbsp; &nbsp;std::string temp_str = std::to_string(timep) +&nbsp;\".jpg\";<br>&nbsp; &nbsp;fp = fopen(temp_str.c_str(),&nbsp;\"wb\");<br>&nbsp; &nbsp;\/\/ \u5c06\u5b57\u7b26\u6570\u7ec4\u5199\u5165\u6587\u4ef6,\u6587\u4ef6\u5373\u4e3a\u56fe\u7247\u6587\u4ef6<br>&nbsp; &nbsp;fwrite(m_pCapBuf, sizeof(char), dwCapSize, fp); \/\/ \u4e0d\u5305\u62ec\u672b\u5c3e\u7684\u7a7a\u5b57\u7b26<br>&nbsp; &nbsp;\/\/ \u5173\u95ed\u6587\u4ef6<br>&nbsp; &nbsp;fclose(fp);<br>&nbsp; }<br><br>if&nbsp;(m_pCapBuf != NULL)<br>&nbsp; {<br>&nbsp; &nbsp;delete&#91;] m_pCapBuf;<br>&nbsp; &nbsp;m_pCapBuf = NULL;<br>&nbsp; }<br>printf(\"\u5b8c\u6210\u7b2c%d\u5f20\u6293\u56fe\\n\", i);<br>&nbsp; \/\/\u7b49\u5f851\u79d2\u540e\u8fdb\u4e0b\u4e0b\u4e00\u6b21\u6293\u56fe<br>&nbsp; Sleep(1000);<br>&nbsp;}<br>}<br><br>\/\/ \u68c0\u67e5\u6587\u4ef6\u5939\u662f\u5426\u5b58\u5728 (C++14\u517c\u5bb9\u65b9\u6cd5)<br>bool folderExists(const std::string&amp; folderPath) {<br>&nbsp;struct&nbsp;stat&nbsp;info;<br>returnstat(folderPath.c_str(), &amp;info) == 0 &amp;&amp; (info.st_mode &amp; S_IFDIR);<br>}<br><br>\/\/ \u521b\u5efa\u6587\u4ef6\u5939 (C++14\u517c\u5bb9\u65b9\u6cd5)<br>bool createFolder(const std::string&amp; folderPath) {<br>return&nbsp;_mkdir(folderPath.c_str()) == 0;<br>}<br><br>\/\/ \u68c0\u67e5\u5e76\u521b\u5efa\u56fe\u7247\u4fdd\u5b58\u6587\u4ef6\u5939<br>bool&nbsp;ensureImageFolderExists() {<br>&nbsp;\/\/ \u68c0\u67e5\u6587\u4ef6\u5939\u662f\u5426\u5b58\u5728<br>if&nbsp;(folderExists(imgFolder)) {<br>&nbsp; std::cout &lt;&lt;&nbsp;\"\u4f7f\u7528\u56fe\u7247\u4fdd\u5b58\u6587\u4ef6\u5939: \"&nbsp;&lt;&lt; imgFolder &lt;&lt; std::endl;<br>returntrue;<br>&nbsp;}<br><br>&nbsp;\/\/ \u5982\u679c\u4e0d\u5b58\u5728\uff0c\u5c1d\u8bd5\u521b\u5efa\u6587\u4ef6\u5939<br>if&nbsp;(createFolder(imgFolder)) {<br>&nbsp; std::cout &lt;&lt;&nbsp;\"\u521b\u5efa\u56fe\u7247\u4fdd\u5b58\u6587\u4ef6\u5939: \"&nbsp;&lt;&lt; imgFolder &lt;&lt; std::endl;<br>returntrue;<br>&nbsp;}<br><br>&nbsp;std::cerr &lt;&lt;&nbsp;\"\u9519\u8bef: \u65e0\u6cd5\u521b\u5efa\u56fe\u7247\u4fdd\u5b58\u6587\u4ef6\u5939\"&nbsp;&lt;&lt; std::endl;<br>returnfalse;<br>}<br><br>\/\/*********************************<br>\/\/ \u51fd\u6570\u5165\u53e3<br>\/\/*********************************<br>int main(int argc, char* argv&#91;])<br>{<br>&nbsp;std::string folderPath =&nbsp;\"Capture\";<br>if&nbsp;(!CreateDirectoryA(folderPath.c_str(), NULL)) {<br>if&nbsp;(GetLastError() != ERROR_ALREADY_EXISTS) {<br>&nbsp; &nbsp;std::cout &lt;&lt;&nbsp;\"Failed to create directory: \"&nbsp;&lt;&lt; folderPath &lt;&lt; std::endl;<br>&nbsp; &nbsp;return&nbsp;1;<br>&nbsp; }<br>&nbsp;}<br><br>&nbsp;\/\/ \u68c0\u67e5\u53c2\u6570\u6570\u91cf<br>if&nbsp;(argc != 5) {<br>printf(\"Usage: %s &lt;IP&gt; &lt;Port&gt; &lt;Username&gt; &lt;Password&gt;\\n\", argv&#91;0]);<br>return&nbsp;1;<br>&nbsp;}<br><br>&nbsp;\/\/ \u4ece\u53c2\u6570\u83b7\u53d6\u8fde\u63a5\u4fe1\u606f<br>&nbsp;const char* deviceAddress = argv&#91;1];<br>&nbsp;WORD wPort = static_cast&lt;WORD&gt;(atoi(argv&#91;2]));<br>&nbsp;const char* userName = argv&#91;3];<br>&nbsp;const char* password = argv&#91;4];<br><br><br>&nbsp;\/\/ \u68c0\u67e5\u5e76\u521b\u5efa\u56fe\u7247\u4fdd\u5b58\u6587\u4ef6\u5939<br>if&nbsp;(!ensureImageFolderExists()) {<br>&nbsp; std::cerr &lt;&lt;&nbsp;\"\u9519\u8bef: \u65e0\u6cd5\u521b\u5efa\u6216\u8bbf\u95ee\u56fe\u7247\u4fdd\u5b58\u6587\u4ef6\u5939\uff0c\u7a0b\u5e8f\u5c06\u9000\u51fa\"&nbsp;&lt;&lt; std::endl;<br>return&nbsp;-1;<br>&nbsp;}<br><br>&nbsp;\/\/---------------------------------------<br>&nbsp;\/\/ \u521d\u59cb\u5316<br>&nbsp;NET_DVR_Init();<br>&nbsp;char ansiStringss&#91;] =&nbsp;\".\/SdkLog\";<br>&nbsp;NET_DVR_SetLogToFile(3, ansiStringss, TRUE);<br>&nbsp;\/\/\u8bbe\u7f6e\u8fde\u63a5\u65f6\u95f4\u4e0e\u91cd\u8fde\u65f6\u95f4<br>&nbsp;NET_DVR_SetConnectTime(2000, 1);<br>&nbsp;NET_DVR_SetReconnect(10000,&nbsp;true);<br><br>&nbsp;\/\/ \u6ce8\u518c\u8bbe\u5907<br>&nbsp;LONG lUserID;<br><br>&nbsp;\/\/\u767b\u5f55\u53c2\u6570\uff0c\u5305\u62ec\u8bbe\u5907\u5730\u5740\u3001\u767b\u5f55\u7528\u6237\u3001\u5bc6\u7801\u7b49<br>&nbsp;NET_DVR_USER_LOGIN_INFO struLoginInfo = { 0 };<br>&nbsp;struLoginInfo.bUseAsynLogin = 0; \/\/\u540c\u6b65\u767b\u5f55\u65b9\u5f0f<br>&nbsp;strncpy(struLoginInfo.sDeviceAddress, deviceAddress, NET_DVR_DEV_ADDRESS_MAX_LEN - 1);\/\/\u8bbe\u5907IP\u5730\u5740<br>&nbsp;struLoginInfo.wPort = wPort;\/\/\u8bbe\u5907\u670d\u52a1\u7aef\u53e3<br>&nbsp;strncpy(struLoginInfo.sUserName, userName, NAME_LEN - 1); \/\/\u8bbe\u5907\u767b\u5f55\u7528\u6237\u540d<br>&nbsp;strncpy(struLoginInfo.sPassword, password, NAME_LEN - 1);\/\/\u8bbe\u5907\u767b\u5f55\u5bc6\u7801<br><br>&nbsp;\/\/\u8bbe\u5907\u4fe1\u606f, \u8f93\u51fa\u53c2\u6570<br>&nbsp;NET_DVR_DEVICEINFO_V40 struDeviceInfoV40 = { 0 };<br>&nbsp;\/\/\u767b\u5f55<br>&nbsp;lUserID = NET_DVR_Login_V40(&amp;struLoginInfo, &amp;struDeviceInfoV40);<br>if&nbsp;(lUserID &lt; 0)<br>&nbsp;{<br>printf(\"Login failed, error code: %d\\n\", NET_DVR_GetLastError());<br>&nbsp; NET_DVR_Cleanup();<br>return&nbsp;1;<br>&nbsp;}<br>&nbsp;\/\/\u9884\u89c8\u76f8\u5173\u53c2\u6570\u8bbe\u7f6e<br>&nbsp;NET_DVR_PREVIEWINFO struPlayInfo = { 0 };<br>&nbsp;struPlayInfo.hPlayWnd = NULL; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u9700\u8981SDK\u89e3\u7801\u65f6\u53e5\u67c4\u8bbe\u4e3a\u6709\u6548\u503c\uff0c\u4ec5\u53d6\u6d41\u4e0d\u89e3\u7801\u65f6\u53ef\u8bbe\u4e3a\u7a7a<br>&nbsp;struPlayInfo.lChannel = 1; &nbsp; &nbsp; &nbsp; \/\/\u9884\u89c8\u901a\u9053\u53f7<br>&nbsp;struPlayInfo.dwStreamType = 0; &nbsp; &nbsp; &nbsp; \/\/0-\u4e3b\u7801\u6d41\uff0c1-\u5b50\u7801\u6d41\uff0c2-\u7801\u6d413\uff0c3-\u7801\u6d414\uff0c\u4ee5\u6b64\u7c7b\u63a8<br>&nbsp;struPlayInfo.dwLinkMode = 0; &nbsp; &nbsp; &nbsp; \/\/0- TCP\u65b9\u5f0f\uff0c1- UDP\u65b9\u5f0f\uff0c2- \u591a\u64ad\u65b9\u5f0f\uff0c3- RTP\u65b9\u5f0f\uff0c4-RTP\/RTSP\uff0c5-RSTP\/HTTP<br>&nbsp;struPlayInfo.bBlocked = 1; &nbsp; &nbsp; &nbsp; \/\/0- \u975e\u963b\u585e\u53d6\u6d41\uff0c1- \u963b\u585e\u53d6\u6d41<br><br>&nbsp;\/\/\u542f\u52a8\u9884\u89c8\u5e76\u8bbe\u7f6e\u56de\u8c03\u6570\u636e\u6d41<br>&nbsp;lRealPlayHandle = NET_DVR_RealPlay_V40(lUserID, &amp;struPlayInfo, g_RealDataCallBack_V30, NULL);\/\/<br><br>if&nbsp;(lRealPlayHandle &lt; 0)<br>&nbsp;{<br>printf(\"NET_DVR_RealPlay_V40 error %d\\n\", NET_DVR_GetLastError());<br>&nbsp; NET_DVR_Logout(lUserID);<br>&nbsp; NET_DVR_Cleanup();<br>return&nbsp;1;<br>&nbsp;}<br><br>&nbsp;\/\/\u7b49\u5f85\u64ad\u653e\u5e93\u6709\u6570\u636e\uff0c\u5426\u5219\u540e\u9762\u65e0\u6cd5\u4f7f\u7528\u64ad\u653e\u5e93\u6293\u56fe<br>&nbsp;\/\/Sleep(3000);<br>&nbsp;\/\/ \u521b\u5efa\u5e76\u542f\u52a8\u6293\u56fe\u7ebf\u7a0b<br>&nbsp;\/\/std::thread t1(getPic);<br>&nbsp;\/\/ \u64ad\u653e\u5e93\u6293\u56fe\u5206\u79bb\u7ebf\u7a0b<br>&nbsp;\/\/t1.detach();<br><br>&nbsp;\/\/ \u7b49\u5f85\u6309\u952e\u9000\u51fa<br>while&nbsp;(true) {<br>if&nbsp;(_kbhit()) { &nbsp;\/\/ \u68c0\u6d4b\u952e\u76d8\u8f93\u5165<br>&nbsp; &nbsp;int key = _getch(); &nbsp;\/\/ \u83b7\u53d6\u6309\u952e<br>&nbsp; &nbsp;if&nbsp;(key == 27) { &nbsp;\/\/ ESC\u952e<br>&nbsp; &nbsp;&nbsp;printf(\"ESC pressed, exiting...\\n\");<br>&nbsp; &nbsp;&nbsp;break;<br>&nbsp; &nbsp;}<br>&nbsp; }<br>&nbsp; Sleep(100); &nbsp;\/\/ \u51cf\u5c11CPU\u5360\u7528<br>&nbsp;}<br><br>&nbsp;\/\/\u5173\u95ed\u9884\u89c8<br>&nbsp;NET_DVR_StopRealPlay(lRealPlayHandle);<br>&nbsp;\/\/\u91ca\u653e\u64ad\u653e\u5e93\u8d44\u6e90<br>&nbsp;PlayM4_Stop(m_lPort&#91;lRealPlayHandle]);<br>&nbsp;\/\/\u5173\u95ed\u6d41<br>&nbsp;PlayM4_CloseStream(m_lPort&#91;lRealPlayHandle]);<br>&nbsp;\/\/\u91ca\u653e\u64ad\u653e\u7aef\u53e3<br>&nbsp;PlayM4_FreePort(m_lPort&#91;lRealPlayHandle]);<br>&nbsp;\/\/\u9000\u51fa\u767b\u5f55<br>&nbsp;NET_DVR_Logout(lUserID);<br>&nbsp;\/\/\u91ca\u653esdk\u8d44\u6e90<br>&nbsp;NET_DVR_Cleanup();<br>return&nbsp;1;<br>}<\/code><\/pre>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u6548\u679c \u9879\u76ee \u4f7f\u7528 Usage: PlayDemo.exe &lt;IP&gt; &lt;Port&gt; &lt;Username &#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":[50],"tags":[],"class_list":["post-6680","post","type-post","status-publish","format-standard","hentry","category-c"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044734911.png","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-1024x576.png","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044738835-1024x576.png","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044744600.png","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2025\/09\/20250929044744600.png","id":"image5"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"C++","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":137,"next_post_id":6717,"next_post_title":"AI\u90e8\u7f72\u901a\u7528C++\u77e5\u8bc6\u70b9--\u9762\u8bd5\u5fc5\u77e5\u5fc5\u4f1a(part1)","previous_post_id":6642,"previous_post_title":"\u3010OpenCV C++ \u5b9e\u6218\u3011RTSP \u6d41\u5904\u7406\uff1a\u5b9e\u65f6\u64ad\u653e\u4e0e\u9010\u5e27\u4fdd\u5b58\u7ec8\u6781\u6307\u5357","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6680","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=6680"}],"version-history":[{"count":1,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6680\/revisions"}],"predecessor-version":[{"id":6684,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/6680\/revisions\/6684"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=6680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=6680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=6680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}