2348
- 收藏
- 点赞
- 分享
- 举报
3519运行SDK中的sample_venc 返回段错误,
我是再调用HI_MPI_VPSS_GetChnFrame函数后,欲取YUV数据,再这个函数后调用了vi_dump里面的sample_yuv_8bit_dump这个函数,初次之外没做任何操作,程序报段错误,希望路过的大佬指点迷津,菜鸟不胜感激。
函数运行后的打印如下:
/data/demo # ./sample_venc 2
The SONY_IMX290_2M_30FPS,the enMode is 0
[SAMPLE_VENC_CheckSensor]-469: Sensor size is (1920,1080), but encode chnl is (1920,1080) !
The SONY_IMX290_2M_30FPS,the enMode is 0
[SAMPLE_COMM_VI_SetMipiAttr]-1333: ============= MipiDev 0, SetMipiAttr enWDRMode: 0
[Func]:cmos_set_wdr_mode [Line]:1345 [Info]:linear mode
===IMX290 1080P 30fps 12bit LINE Init OK!===
The SONY_IMX290_2M_30FPS,the enMode is 0
[SAMPLE_COMM_ISP_Thread]-173: ISP Dev 0 running !
please input choose gop mode!
0) NORMALP.
1) DUALP.
2) SMARTP.
3) BIPREDB
0
PT_H265
SAMPLE_RC_QPMAP
PT_H264
please press twice ENTER to exit this sample
The PIXEL_FORMAT_YUV_SEMIPLANAR_420!
The phy_addr: 3b6e2600, size: 3110400
stride: 1920,1920
saving......Y......
Segmentation fault
程序退出了!
通过cat /dev/logmpp查看显示:
/data # cat /dev/logmpp
mmz_userdev:mmz_userdev_release: MMB LEAK(pid=252): 0x3E6EC000, 69632 bytes, ''
mmz_userdev:mmz_userdev_release: mmb<0x3e6ec000> mapped to userspace 0xb4126000 will be unmaped!
mmz_userdev:mmz_userdev_release: MMB LEAK(pid=252): 0x3E6FD000, 36864 bytes, ''
mmz_userdev:mmz_userdev_release: mmb<0x3e6fd000> mapped to userspace 0xb411d000 will be unmaped!
mmz_userdev:mmz_userdev_release: MMB LEAK(pid=252): 0x3E706000, 4096 bytes, ''
mmz_userdev:mmz_userdev_release: mmb<0x3e706000> mapped to userspace 0xb411c000 will be unmaped!
函数如下:sample_yuv_8bit_dump:
if (PIXEL_FORMAT_YVU_SEMIPLANAR_420 == enPixelFormat)
{
u32Size = (pVBuf->u32Stride[0]) * (pVBuf->u32Height) * 3 / 2;
u32UvHeight = pVBuf->u32Height / 2;
}
else if(PIXEL_FORMAT_YVU_SEMIPLANAR_422 == enPixelFormat)
{
printf("The PIXEL_FORMAT_YVU_SEMIPLANAR_422!\n");
u32Size = (pVBuf->u32Stride[0]) * (pVBuf->u32Height) * 2;
u32UvHeight = pVBuf->u32Height;
}
else if(PIXEL_FORMAT_YUV_400 == enPixelFormat)
{
printf("The PIXEL_FORMAT_YUV_400!\n");
u32Size = (pVBuf->u32Stride[0]) * (pVBuf->u32Height);
u32UvHeight = pVBuf->u32Height;
}
else
{
printf("%s %d: This YUV format is not support!\n",__func__, __LINE__);
return;
}
phy_addr = pVBuf->u64PhyAddr[0];
printf("The phy_addr: %x, size: %d\n",phy_addr, u32Size);
pUserPageAddr[0] = (HI_CHAR*) HI_MPI_SYS_Mmap(phy_addr, u32Size);
if (HI_NULL == pUserPageAddr[0])
{
return;
}
printf("stride: %d,%d\n",pVBuf->u32Stride[0], pVBuf->u32Stride[1]);
pY_map = pUserPageAddr[0];
pC_map = pY_map + (pVBuf->u32Stride[0]) * (pVBuf->u32Height);
fprintf(stderr, "saving......Y......\n");
fflush(stderr);
if(VIDEO_FORMAT_TILE_16x8 == enVideoFormat)
{
for (h = 0; h < pVBuf->u32Height; h++)
{
printf("get......Y........\n");
pMemContent = pY_map + h * pVBuf->u32Stride[0];
printf("check Segmentation...1........\n");
fwrite(pMemContent, pVBuf->u32Stride[0], 1, pfd);
}
}
else
{
for (h = 0; h < pVBuf->u32Height; h++)
{
pMemContent = pY_map + h * pVBuf->u32Stride[0];
fwrite(pMemContent, pVBuf->u32Width, 1, pfd);
}
}
if(PIXEL_FORMAT_YUV_400 != enPixelFormat && VIDEO_FORMAT_TILE_16x8 != enVideoFormat)
{
fflush(pfd);
fprintf(stderr, "U......");
fflush(stderr);
for (h = 0; h < u32UvHeight; h++)
{
printf("check Segmentation...4........\n");
pMemContent = pC_map + h * pVBuf->u32Stride[1];
pMemContent += 1;
for (w = 0; w < pVBuf->u32Width / 2; w++)
{
pTmpBuff[w] = *pMemContent;
pMemContent += 2;
}
fwrite(pTmpBuff, pVBuf->u32Width / 2, 1, pfd);
}
fflush(pfd);
fprintf(stderr, "V......");
fflush(stderr);
for (h = 0; h < u32UvHeight; h++)
{
pMemContent = pC_map + h * pVBuf->u32Stride[1];
for (w = 0; w < pVBuf->u32Width / 2; w++)
{
pTmpBuff[w] = *pMemContent;
pMemContent += 2;
}
fwrite(pTmpBuff, pVBuf->u32Width / 2, 1, pfd);
}
}
fflush(pfd);
fprintf(stderr, "done %d!\n", pVBuf->u32TimeRef);
fflush(stderr);
HI_MPI_SYS_Munmap(pUserPageAddr[0], u32Size);
pUserPageAddr[0] = HI_NULL;
return;
函数运行后的打印如下:
/data/demo # ./sample_venc 2
The SONY_IMX290_2M_30FPS,the enMode is 0
[SAMPLE_VENC_CheckSensor]-469: Sensor size is (1920,1080), but encode chnl is (1920,1080) !
The SONY_IMX290_2M_30FPS,the enMode is 0
[SAMPLE_COMM_VI_SetMipiAttr]-1333: ============= MipiDev 0, SetMipiAttr enWDRMode: 0
[Func]:cmos_set_wdr_mode [Line]:1345 [Info]:linear mode
===IMX290 1080P 30fps 12bit LINE Init OK!===
The SONY_IMX290_2M_30FPS,the enMode is 0
[SAMPLE_COMM_ISP_Thread]-173: ISP Dev 0 running !
please input choose gop mode!
0) NORMALP.
1) DUALP.
2) SMARTP.
3) BIPREDB
0
PT_H265
SAMPLE_RC_QPMAP
PT_H264
please press twice ENTER to exit this sample
The PIXEL_FORMAT_YUV_SEMIPLANAR_420!
The phy_addr: 3b6e2600, size: 3110400
stride: 1920,1920
saving......Y......
Segmentation fault
程序退出了!
通过cat /dev/logmpp查看显示:
/data # cat /dev/logmpp
mmz_userdev:mmz_userdev_release: MMB LEAK(pid=252): 0x3E6EC000, 69632 bytes, ''
mmz_userdev:mmz_userdev_release: mmb<0x3e6ec000> mapped to userspace 0xb4126000 will be unmaped!
mmz_userdev:mmz_userdev_release: MMB LEAK(pid=252): 0x3E6FD000, 36864 bytes, ''
mmz_userdev:mmz_userdev_release: mmb<0x3e6fd000> mapped to userspace 0xb411d000 will be unmaped!
mmz_userdev:mmz_userdev_release: MMB LEAK(pid=252): 0x3E706000, 4096 bytes, ''
mmz_userdev:mmz_userdev_release: mmb<0x3e706000> mapped to userspace 0xb411c000 will be unmaped!
函数如下:sample_yuv_8bit_dump:
if (PIXEL_FORMAT_YVU_SEMIPLANAR_420 == enPixelFormat)
{
u32Size = (pVBuf->u32Stride[0]) * (pVBuf->u32Height) * 3 / 2;
u32UvHeight = pVBuf->u32Height / 2;
}
else if(PIXEL_FORMAT_YVU_SEMIPLANAR_422 == enPixelFormat)
{
printf("The PIXEL_FORMAT_YVU_SEMIPLANAR_422!\n");
u32Size = (pVBuf->u32Stride[0]) * (pVBuf->u32Height) * 2;
u32UvHeight = pVBuf->u32Height;
}
else if(PIXEL_FORMAT_YUV_400 == enPixelFormat)
{
printf("The PIXEL_FORMAT_YUV_400!\n");
u32Size = (pVBuf->u32Stride[0]) * (pVBuf->u32Height);
u32UvHeight = pVBuf->u32Height;
}
else
{
printf("%s %d: This YUV format is not support!\n",__func__, __LINE__);
return;
}
phy_addr = pVBuf->u64PhyAddr[0];
printf("The phy_addr: %x, size: %d\n",phy_addr, u32Size);
pUserPageAddr[0] = (HI_CHAR*) HI_MPI_SYS_Mmap(phy_addr, u32Size);
if (HI_NULL == pUserPageAddr[0])
{
return;
}
printf("stride: %d,%d\n",pVBuf->u32Stride[0], pVBuf->u32Stride[1]);
pY_map = pUserPageAddr[0];
pC_map = pY_map + (pVBuf->u32Stride[0]) * (pVBuf->u32Height);
fprintf(stderr, "saving......Y......\n");
fflush(stderr);
if(VIDEO_FORMAT_TILE_16x8 == enVideoFormat)
{
for (h = 0; h < pVBuf->u32Height; h++)
{
printf("get......Y........\n");
pMemContent = pY_map + h * pVBuf->u32Stride[0];
printf("check Segmentation...1........\n");
fwrite(pMemContent, pVBuf->u32Stride[0], 1, pfd);
}
}
else
{
for (h = 0; h < pVBuf->u32Height; h++)
{
pMemContent = pY_map + h * pVBuf->u32Stride[0];
fwrite(pMemContent, pVBuf->u32Width, 1, pfd);
}
}
if(PIXEL_FORMAT_YUV_400 != enPixelFormat && VIDEO_FORMAT_TILE_16x8 != enVideoFormat)
{
fflush(pfd);
fprintf(stderr, "U......");
fflush(stderr);
for (h = 0; h < u32UvHeight; h++)
{
printf("check Segmentation...4........\n");
pMemContent = pC_map + h * pVBuf->u32Stride[1];
pMemContent += 1;
for (w = 0; w < pVBuf->u32Width / 2; w++)
{
pTmpBuff[w] = *pMemContent;
pMemContent += 2;
}
fwrite(pTmpBuff, pVBuf->u32Width / 2, 1, pfd);
}
fflush(pfd);
fprintf(stderr, "V......");
fflush(stderr);
for (h = 0; h < u32UvHeight; h++)
{
pMemContent = pC_map + h * pVBuf->u32Stride[1];
for (w = 0; w < pVBuf->u32Width / 2; w++)
{
pTmpBuff[w] = *pMemContent;
pMemContent += 2;
}
fwrite(pTmpBuff, pVBuf->u32Width / 2, 1, pfd);
}
}
fflush(pfd);
fprintf(stderr, "done %d!\n", pVBuf->u32TimeRef);
fflush(stderr);
HI_MPI_SYS_Munmap(pUserPageAddr[0], u32Size);
pUserPageAddr[0] = HI_NULL;
return;
我来回答
回答2个
时间排序
认可量排序
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2017-04-21 11:23:16
-
2016-05-17 16:38:43
-
2017-06-08 15:30:45
-
2017-06-19 20:18:14
-
2020-09-27 11:32:35
-
2017-05-11 13:28:58
-
2020-06-18 19:13:20
-
2021-08-06 21:37:52
-
2017-11-24 09:50:32
-
2017-11-02 11:52:30
-
2018-08-30 11:17:58
-
2017-11-07 08:58:40
-
2016-09-18 11:07:57
-
2016-12-23 09:28:16
-
2016-07-12 21:01:32
-
2018-02-12 14:56:12
-
2018-02-10 17:08:27
-
2013-12-31 22:51:08
-
2024-02-21 15:46:37
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
-
10求HI3519DV500_SDK_V2.0.1.1
-
5有偿求HI3516DV500 + OV5647驱动
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认