esp camera 配置为JPEG输出格式出现问题

Donocean
Posts: 6
Joined: Mon Jul 03, 2023 4:10 am

esp camera 配置为JPEG输出格式出现问题

Postby Donocean » Mon Mar 11, 2024 11:03 am

初始化代码:

Code: Select all

app_camera_init(PIXFORMAT_JPEG, FRAMESIZE_96X96, 1);
报错信息如下:
W (6535) cam_hal: NO-EOI
W (6737) cam_hal: FB-OVF
W (6737) cam_hal: FB-OVF
W (6737) cam_hal: NO-EOI
W (6939) cam_hal: FB-OVF
W (6940) cam_hal: FB-OVF

***ERROR*** A stack overflow in task cam_task has been detected.


Backtrace:0x40375df6:0x3fce23400x40381be9:0x3fce2360 0x40384b32:0x3fce2380 0x403838fb:0x3fce2400 0x40381ca4:0x3fce2420 0x40381c9a:0x00000000 |<-CORRUPTED
0x40375df6: panic_abort at /home/don/esp/esp-idf/components/esp_system/panic.c:402

0x40381be9: esp_system_abort at /home/don/esp/esp-idf/components/esp_system/esp_system.c:121

0x40384b32: vApplicationStackOverflowHook at /home/don/esp/esp-idf/components/freertos/port/xtensa/port.c:394

0x403838fb: vTaskSwitchContext at /home/don/esp/esp-idf/components/freertos/tasks.c:3506

0x40381ca4: _frxt_dispatch at /home/don/esp/esp-idf/components/freertos/port/xtensa/portasm.S:436

0x40381c9a: _frxt_int_exit at /home/don/esp/esp-idf/components/freertos/port/xtensa/portasm.S:231
经过检查,发现

Code: Select all

camera_fb_t* esp_camera_fb_get(void);
函数中有递归实现:

Code: Select all

            int offset_e = cam_verify_jpeg_eoi(dma_buffer->buf, dma_buffer->len);
            if (offset_e >= 0) {
                // adjust buffer length
                dma_buffer->len = offset_e + sizeof(JPEG_EOI_MARKER);
                return dma_buffer;
            } else {
                ESP_LOGW(TAG, "NO-EOI");
                cam_give(dma_buffer);
                TickType_t ticks_spent = xTaskGetTickCount() - start;
                if (ticks_spent >= timeout) {
                    return NULL; /* We are out of time */
                }
                return cam_take(timeout - ticks_spent);//recurse!!!!
            }
想知道究竟是什么原因 :cry:

Donocean
Posts: 6
Joined: Mon Jul 03, 2023 4:10 am

Re: esp camera 配置为JPEG输出格式出现问题

Postby Donocean » Tue Mar 12, 2024 4:21 am

idf版本:4.4
esp-camera版本:2.0.8

ESP_WangYX
Posts: 97
Joined: Mon Jun 28, 2021 12:48 pm

Re: esp camera 配置为JPEG输出格式出现问题

Postby ESP_WangYX » Tue Mar 12, 2024 6:09 am

正在使用哪个 sensor ? 不是所有的分辨率都提供支持。

Donocean
Posts: 6
Joined: Mon Jul 03, 2023 4:10 am

Re: esp camera 配置为JPEG输出格式出现问题

Postby Donocean » Tue Mar 12, 2024 6:34 am

ESP_WangYX wrote:
Tue Mar 12, 2024 6:09 am
正在使用哪个 sensor ? 不是所有的分辨率都提供支持。
使用OV2640

ESP_WangYX
Posts: 97
Joined: Mon Jun 28, 2021 12:48 pm

Re: esp camera 配置为JPEG输出格式出现问题

Postby ESP_WangYX » Wed Mar 13, 2024 8:30 am

是的,JPEG 模式不支持这个分辨率,但是可以配置在 RGB565 格式工作。可以使用这里的示例进行测试:
https://github.com/espressif/esp-iot-so ... eam_server
推荐的配置参数是:XCLK=20M、RGB565。

Donocean
Posts: 6
Joined: Mon Jul 03, 2023 4:10 am

Re: esp camera 配置为JPEG输出格式出现问题

Postby Donocean » Fri Mar 15, 2024 9:06 am

请问对于其他摄像头,我从哪可以知道JPEG所支持的分辨率?我从文档里并没有见到对应的说明

Who is online

Users browsing this forum: No registered users and 94 guests