当前位置: 首页 > news >正文

中法电商网站建设微信管理工具

中法电商网站建设,微信管理工具,山东胶州建设工程招标网站,一站式网站建设公司一、简介:libyuv 最初是由Google开发的,主要是为了支持WebRTC项目中的视频处理需求。用于处理YUV格式图像数据的开源库。它提供了一系列的函数,用于转换、缩放、旋转和其他操作YUV图像数据。 二、执行下面的命令下载和安装libyuv。 git clo…

一、简介:libyuv 最初是由Google开发的,主要是为了支持WebRTC项目中的视频处理需求。用于处理YUV格式图像数据的开源库。它提供了一系列的函数,用于转换、缩放、旋转和其他操作YUV图像数据。

二、执行下面的命令下载和安装libyuv。

git clone https://github.com/lemenkov/libyuv.git
cd libyuv
mkdir build && cd build
cmake ..
make
sudo make install

三、测试实例convert_yuv_to_rgb.cpp,使用c编译的时候,I420ToRGB24前面就不要有libyuv::。

#include <stdio.h>
#include <stdlib.h>
#include "libyuv/convert_from.h"
#include "libyuv/convert.h"int main() {FILE *input_file = fopen("cowboy_girl_1024X1280_yuv420p_i420.yuv", "rb");if (!input_file) {printf("Error opening input file.\n");return 1;}int width = 1024;int height = 1280;size_t uv_size = (width * height) / 2;uint8_t *yuv_data = (uint8_t *)malloc(width * height * 3 / 2);if (!yuv_data) {printf("Memory allocation error.\n");fclose(input_file);return 1;}fread(yuv_data, sizeof(uint8_t), width * height * 3 / 2, input_file);fclose(input_file);// Convert YUV to RGB24uint8_t *rgb_data = (uint8_t *)malloc(width * height * 3);if (!rgb_data) {printf("Memory allocation error.\n");free(yuv_data);return 1;}libyuv::I420ToRGB24(yuv_data, width, yuv_data + width * height, width / 2,yuv_data + width * height * 5 / 4, width / 2,rgb_data, width * 3, width, height);
/*libyuv::I420ToRAW(yuv_data, width, yuv_data + width * height, width / 2,yuv_data + width * height * 5 / 4, width / 2,rgb_data, width * 3, width, height);
*/// Save RGB image to fileFILE *output_file = fopen("output.rgb", "wb");if (!output_file) {printf("Error opening output file.\n");free(yuv_data);free(rgb_data);return 1;}fwrite(rgb_data, sizeof(uint8_t), width * height * 3, output_file);fclose(output_file);free(yuv_data);free(rgb_data);printf("Conversion complete.\n");return 0;
}

四、测试运行结果

g++ -o convert_yuv_to_rgb convert_yuv_to_rgb.cpp -lyuv
./convert_yuv_to_rgb

五、上面的测试得出的yuv文件显示出来的效果有点异常,R和B对换了,为啥呢?这个问题困扰了我许久。直到我看到我看到libyuv/include/libyuv/convert.h里面有这一段才豁然开朗,因为RGB24ToI420也是存在这个问题,解决方法是使用I420ToRAW、RAWToI420对换。

// RGB little endian (bgr in memory) to I420.
LIBYUV_API
int RGB24ToI420(const uint8_t* src_rgb24,int src_stride_rgb24,uint8_t* dst_y,int dst_stride_y,uint8_t* dst_u,int dst_stride_u,uint8_t* dst_v,int dst_stride_v,int width,int height);

六、如果运行的时候提示找不到libyuv.so库,按照下面的方法运行sudo ldconfig更新动态链接库缓存。也可以直接用gcc -o yuv yuv.c  /usr/local/lib/libyuv.so这种编译形式。

编辑配置文件并使新安装的库生效:
sudo vi /etc/ld.so.conf
在末尾加入如下行:
include /usr/local/libsudo ldconfig

http://www.hkea.cn/news/258280/

相关文章:

  • 宜昌网站建设兼职百度关键词排名软件
  • 如何让百度快照找到自己的网站营销策划方案ppt模板
  • php网站超市广告软文是什么意思
  • b2c跨境电商宣城网站seo
  • 网站建设一流公司免费网站开发平台
  • 网站开发模式名词外贸谷歌优化
  • 网站素材 下载产品推广渠道
  • 网站后台维护怎么做seo专员工资一般多少
  • 中国网站推广黄页名录微商推广哪家好
  • 哈尔滨网站开发电话电商培训基地
  • 如何用php数据库做网站搜索seo优化托管
  • 中国城乡建设部人力网站首页优化落实疫情防控
  • 做网站到底能不能赚钱网络优化工程师前景
  • 乌镇网站建设标书百度站长工具域名查询
  • 制作公司网站价格腾讯广告代理商加盟
  • 大学生活动网站开发文案苏州seo门户网
  • 阿里云认证网站建设题库seo助理
  • 凤岗网站仿做靠谱seo外包定制
  • xampp安装wordpress说明徐州seo外包
  • 啥网站都能看的浏览器下载百度收录查询工具
  • 福田附近公司做网站建设哪家效益快奶糖 seo 博客
  • 临沂免费自助建站模板品牌整合营销
  • iis做本地视频网站找客户资源的网站
  • 做调查用哪个网站网络推广有多少种方法
  • 开发一个交易网站多少钱在线工具
  • 网站平台怎么建立的软文范例
  • 移动应用开发专业学什么东莞seo软件
  • 做宣传网站的公司手机百度极速版app下载安装
  • 私人可以做慈善网站吗外贸如何推广
  • 网站页面模板页面布局如何成为百度广告代理商