// 配置JPEG编码器参数
jpeg_enc_config_t jpeg_enc_cfg = DEFAULT_JPEG_ENC_CONFIG();
jpeg_enc_cfg.width = 240;// 编码图像宽度(需与摄像头分辨率匹配)
jpeg_enc_cfg.height = 240;// 编码图像高度
jpeg_enc_cfg.src_type = JPEG_PIXEL_FORMAT_CbYCrY;// YUV422像素格式
jpeg_enc_cfg.subsampling = JPEG_SUBSAMPLE_422;// 4:2:0色度抽样
jpeg_enc_cfg.quality = 80; // 压缩质量(0-100)
jpeg_enc_cfg.rotate = JPEG_ROTATE_0D;// 无旋转
jpeg_enc_cfg.task_enable = false;// 禁用硬件加速任务
jpeg_enc_cfg.hfm_task_priority = 13;// 硬件任务优先级(未启用)
jpeg_enc_cfg.hfm_task_core = 1;// 指定运行核心
jpeg_error_t ret = JPEG_ERR_OK;
int image_size = jpeg_enc_cfg.width * jpeg_enc_cfg.height * 2;// 原始数据大小
int outbuf_size = 240 * 240;// 输出缓冲区大小
jpeg_enc_handle_t jpeg_enc = NULL;// 编码器句柄
// 初始化JPEG编码器
ret = jpeg_enc_open(&jpeg_enc_cfg, &jpeg_enc);
if (ret != JPEG_ERR_OK)
{
return ret;// 编码器初始化失败直接返回
}
运行报错
E (28384) JPEG_ENC: JPEG src type(7) error, line 525
E (28384) JPEG_ENC: JPEG encoder open fail. line 74
W (28384) httpd_uri: httpd_uri: uri handler execution failed
E (28404) JPEG_ENC: JPEG src type(7) error, line 525
E (28404) JPEG_ENC: JPEG encoder open fail. line 74
esp_new_jpeg编码不能使用JPEG_PIXEL_FORMAT_CbYCrY格式
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- ESP32-S31
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- ESP32-S31 中文讨论版
- 喵伴 中文讨论版
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 1 guest
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.
Information
Espressif ESP32 ... Available now!