图像时不时出现一帧花屏,出现频率还很高,请问是哪里出问题了吗?

xiang8000
Posts: 15
Joined: Wed Apr 22, 2020 2:05 am

图像时不时出现一帧花屏,出现频率还很高,请问是哪里出问题了吗?

Postby xiang8000 » Wed Jun 03, 2020 4:59 pm

摄像头在正常运行显示图像时,monitor中时不时会出现 bh 0x001d2d05 白色字样,此时该帧图像会显示花掉,monitor显示如下:

I (551899) camera_httpd: MJPG: 32000B 41ms (24.4fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
I (551939) camera_httpd: MJPG: 31942B 40ms (25.0fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
I (551979) camera_httpd: MJPG: 31733B 35ms (28.6fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
I (552019) camera_httpd: MJPG: 32000B 43ms (23.3fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
I (552059) camera_httpd: MJPG: 31813B 43ms (23.3fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
I (552099) camera_httpd: MJPG: 31831B 35ms (28.6fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
I (552139) camera_httpd: MJPG: 31443B 43ms (23.3fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
I (552179) camera_httpd: MJPG: 31740B 34ms (29.4fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
bh 0x001d2d05
I (552219) camera_httpd: MJPG: 31320B 47ms (21.3fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
I (552349) camera_httpd: MJPG: 31571B 123ms (8.1fps), AVG: 43ms (23.3fps), 0+0+0+0=0 0
I (552369) camera_httpd: MJPG: 31199B 20ms (50.0fps), AVG: 42ms (23.8fps), 0+0+0+0=0 0

查看代码,出现该提示字样在 esp-who\components\esp32-camera\driver\camera.c 这个文件中的

static void IRAM_ATTR dma_filter_buffer(size_t buf_idx)
{
//no need to process the data if frame is in use or is bad
if(s_state->fb->ref || s_state->fb->bad) {
return;
}

//check if there is enough space in the frame buffer for the new data
size_t buf_len = s_state->width * s_state->fb_bytes_per_pixel / s_state->dma_per_line;
size_t fb_pos = s_state->dma_filtered_count * buf_len;
if(fb_pos > s_state->fb_size - buf_len) {
//size_t processed = s_state->dma_received_count * buf_len;
//ets_printf("[%s:%u] ovf pos: %u, processed: %u\n", __FUNCTION__, __LINE__, fb_pos, processed);
return;
}

//convert I2S DMA buffer to pixel data
(*s_state->dma_filter)(s_state->dma_buf[buf_idx], &s_state->dma_desc[buf_idx], s_state->fb->buf + fb_pos);

//first frame buffer
if(!s_state->dma_filtered_count) {
//check for correct JPEG header
if(s_state->sensor.pixformat == PIXFORMAT_JPEG) {
uint32_t sig = *((uint32_t *)s_state->fb->buf) & 0xFFFFFF;
if(sig != 0xffd8ff) {
ets_printf("bh 0x%08x\n", sig);
s_state->fb->bad = 1;
return;
}
}
//set the frame properties
s_state->fb->width = resolution[s_state->sensor.status.framesize].width;
s_state->fb->height = resolution[s_state->sensor.status.framesize].height;
s_state->fb->format = s_state->sensor.pixformat;

uint64_t us = (uint64_t)esp_timer_get_time();
s_state->fb->timestamp.tv_sec = us / 1000000UL;
s_state->fb->timestamp.tv_usec = us % 1000000UL;
}
s_state->dma_filtered_count++;
}

能帮我分析处理下形成这个问题的原因吗?感谢!

xiang8000
Posts: 15
Joined: Wed Apr 22, 2020 2:05 am

Re: 图像时不时出现一帧花屏,出现频率还很高,请问是哪里出问题了吗?

Postby xiang8000 » Thu Jun 04, 2020 7:03 am

大大来了吗?

xiang8000
Posts: 15
Joined: Wed Apr 22, 2020 2:05 am

Re: 图像时不时出现一帧花屏,出现频率还很高,请问是哪里出问题了吗?

Postby xiang8000 » Thu Jun 04, 2020 4:34 pm

:( 都一天了,没人理我~~~好难过

xiang8000
Posts: 15
Joined: Wed Apr 22, 2020 2:05 am

Re: 图像时不时出现一帧花屏,出现频率还很高,请问是哪里出问题了吗?

Postby xiang8000 » Mon Jun 08, 2020 7:54 am

都一周了,没人理我~~~好难过

xiang8000
Posts: 15
Joined: Wed Apr 22, 2020 2:05 am

Re: 图像时不时出现一帧花屏,出现频率还很高,请问是哪里出问题了吗?

Postby xiang8000 » Thu Jun 11, 2020 1:15 am

都两周了,没人理我~~~好难过 :(

Who is online

Users browsing this forum: No registered users and 10 guests