![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
宁强核桃饼
人生路殊途同归
展开
-
解图片存到Mat
Mat Canvas::http_get_image(string url){ //http://192.168.0.129/cache/convert/58d17d693f85fb3708f95da032e4342e/0.png string host = ""; string port = "80"; string page = ""; size_t datalen = 0; int p2 = 0; for (int i = 0; i < 2; i++) { p2 = u原创 2021-07-12 12:25:45 · 94 阅读 · 2 评论 -
Opencv Mat->data编码成H264 利用ffmpeg实现
默认Mat 中的像素数据是BGR24ffpmeg编码时,需要YUV420P注意编码时的一帧画面的宽高main Encodeh264 codeh264_obj; codeh264_obj.init_encoder(AV_CODEC_ID_H264,CANVAS_WIDTH, CANVAS_HEIGHT, AV_PIX_FMT_BGR24, CANVAS_WIDTH, CANVAS_HEIGHT, AV_PIX_FMT_YUV420P); while (1) { if (m_con.原创 2021-05-27 18:20:17 · 1336 阅读 · 4 评论 -
nlohmann轻松解析json,低依赖
源项目连接https://github.com/nlohmann/json#json-as-first-class-data-type#include "json.hpp"using json = nlohmann::json;void main(const std::string & message){ printf(">>> %s\n", message.c_str()); using json = nlohmann::json; // create原创 2021-05-18 09:57:11 · 486 阅读 · 2 评论