50
- 收藏
- 点赞
- 分享
- 举报
hi_mpi_vpss_get_chn_frame 获取yuv 数据后有问题?
我在3519的mpp6.0 的vio例程上进行修改。
在vpss启动后调用了
hi_mpi_vpss_get_chn_frame获取一帧yuv格式图像
存储后,我用yuv查看工具查看
看这个结果好像是 把y分量的数据放到 uv分量的地址上了。而且 uv分量各有一半图像。
这是为啥呢?
以下为 获取vpss 源码
if ((ret=hi_mpi_vpss_get_chn_frame(vpss_grp[0], HI_VPSS_CHN0,&video_frameInfo, 1000)) != HI_SUCCESS)
{ /* 1000 is a number */
sample_print("HI_MPI_VPSS_GetChnFrame err:0x%x\n", ret);
continue;
}else{
printf("get vpss chn succ \n");
}
printf("stride %d %d \n",video_frameInfo.video_frame.stride[0],video_frameInfo.video_frame.stride[1]);
int imageYSize = video_frameInfo.video_frame.width*video_frameInfo.video_frame.height;
int imageUVsize = video_frameInfo.video_frame.width*video_frameInfo.video_frame.height / 2;
int l_imageSize = video_frameInfo.video_frame.width*video_frameInfo.video_frame.height*3/2;
void* Yaddr = hi_mpi_sys_mmap(video_frameInfo.video_frame.phys_addr[0],l_imageSize);
// void* uvaddr = hi_mpi_sys_mmap(video_frameInfo.video_frame.phys_addr[1],imageUVsize);
int l_height = video_frameInfo.video_frame.height;
int l_width = video_frameInfo.video_frame.width;
int l_stride = video_frameInfo.video_frame.width;
FILE *fp = fopen("./image.yuv","wb");
if(fp == NULL)
{
printf("fopen image.yuv faile\n");
}
// 假设 stride 为对齐后的行宽(可能大于 width)
// for (int y_row = 0; y_row < l_height; y_row++) {
// fwrite(Yaddr+ y_row * l_stride, 1, l_width, fp); // 写入 Y 分量
// }
// for (int uv_row = 0; uv_row < l_height/2; uv_row++) {
// fwrite(uvaddr + uv_row * l_stride, 1, l_width, fp); // 写入 UV 分量
// }
fwrite(Yaddr,1,l_imageSize,fp);
fclose(fp);
hi_mpi_sys_munmap(Yaddr, l_imageSize);
// hi_mpi_sys_munmap(uvaddr, imageUVsize);
hi_mpi_vpss_release_chn_frame(vpss_grp[0], HI_VPSS_CHN0, &video_frameInfo);
----------------------------------------vpss module param---------------------------------------------------------------
schedule_mode max_out_width max_out_height high_profile
NORMAL 8192 8192 N
----------------------------------------vpss grp cfg1-------------------------------------------------------------------
grp is_rotation_input_support is_dis_gyro_support is_motion_denoise_support
0 N N N
----------------------------------------vpss grp cfg2-------------------------------------------------------------------
grp max_split_num max_out_rgn_num is_save_out_lut out_lut_buf_size
0 3 1 N 0
----------------------------------------vpss grp attr1------------------------------------------------------------------
grp max_w max_h pixel_fmt src_rate dst_rate user_ctrl backup
0 3840 2160 YVU-SP420 -1 -1 Y N
----------------------------------------vpss grp attr2------------------------------------------------------------------
grp buf_share_en buf_share_chn dci ie dei_mode dei_width dei_height mcf_en act_buf_share
0 N 0 N N OFF 0 0 N N
----------------------------------------vpss grp crop info--------------------------------------------------------------
grp crop_en coord x y width height trim_x trim_y trim_width trim_height
0 N ABS 0 0 0 0 0 0 3840 2160
----------------------------------------vpss grp 3dnr attr--------------------------------------------------------------
grp enable type ref_cmp motion_mode
0 N VIDEO N NORM
----------------------------------------vpss 3dnr param-----------------------------------------------------------------
----------------------------------------frame interrupt attr------------------------------------------------------------
grp int_type early_line
0 - 0
----------------------------------------vpss grp gdc param--------------------------------------------------------------
grp in_width in_height lut_cell_size
0 3840 2160 16
----------------------------------------vpss grp spread attr------------------------------------------------------------
grp enable coef
----------------------------------------vpss grp ldc v1 attr------------------------------------------------------------
grp enable aspect x_ratio y_ratio xy_ratio center_x_offset center_y_offset distortion_ratio
----------------------------------------vpss grp ldc v2 attr------------------------------------------------------------
grp enable aspect x_ratio y_ratio xy_ratio len_x len_y shift_x shift_y coef_intp_ratio
----------------------------------------vpss grp rotation attr----------------------------------------------------------
grp enable rotation_type view_type angle x_offset y_offset width height
----------------------------------------vpss grp fisheye attr-----------------------------------------------------------
grp enable mount_mode rgn_num bg_color lmf_en hor_offset ver_offset trapezoid_coef fan_strength
----------------------------------------vpss grp fisheye rgn attr-------------------------------------------------------
grp rgn_index view_mode in_radius out_radius pan tilt hor_zoom ver_zoom out_x out_y out_w out_h
----------------------------------------vpss grp pmf attr---------------------------------------------------------------
grp enable width height pmf_coef
----------------------------------------vpss grp zoom in window attr----------------------------------------------------
grp enable mode x y width height trim_x trim_y trim_width trim_height valid
----------------------------------------vpss grp fov attr---------------------------------------------------------------
grp enable fov_coef
----------------------------------------vpss grp lut attr---------------------------------------------------------------
grp pre_lut_en post_lut_en lut_mode ratio
----------------------------------------vpss grp lut--------------------------------------------------------------------
grp name in_width in_height out_width out_height cell_size phys_addr
----------------------------------------vpss grp zme attr---------------------------------------------------------------
grp width height
----------------------------------------vpss grp stitch attr------------------------------------------------------------
grp enable pipe_num sync_en stitch_mode correction_mode
----------------------------------------vpss grp stitch correction cylindrical attr-------------------------------------
grp pipe pmf_enable dst_width dst_height x_offset y_offset ratio pmf_coef
----------------------------------------vpss grp stitch correction lut attr---------------------------------------------
grp pipe in_width in_height out_width out_height cell_size phys_addr
----------------------------------------vpss grp stitch luma sync staus-------------------------------------------------
grp sync_en milli_sec isp_pipe smooth_strength shading_adjust_thr real_sync_en last_sync_interval
----------------------------------------vpss grp stitch blend param-----------------------------------------------------
grp buf_num position[0] range[0] position[1] range[1] position[2] range[2]
----------------------------------------vpss chn crop info--------------------------------------------------------------
grp chn crop_en coord x y width height trim_x trim_y trim_width trim_height
0 0 N ABS 0 0 0 0
----------------------------------------vpss chn attr1------------------------------------------------------------------
grp chn enable mode width height align mirror flip src_rate dst_rate depth vb_src pool_id
0 0 Y USER 3840 2160 32 N N -1 -1 3 common -
----------------------------------------vpss chn attr2------------------------------------------------------------------
grp chn aspect video_x video_y video_w video_h bg_color border left_w right_w top_w bottom_w bd_color
0 0 NONE 0 0 3840 2160 0x0 N 0 0 0 0 0x0
----------------------------------------vpss chn attr3------------------------------------------------------------------
grp chn sharpen sp_strength quick_send scale_type
0 0 N 0 N NORMAL
----------------------------------------vpss chn fmu info---------------------------------------------------------------
grp chn fmu_mode
0 0 off
----------------------------------------vpss ext chn attr1--------------------------------------------------------------
grp ext_chn enable src_chn width height src_rate dst_rate depth align src_type vb_src pool_id
----------------------------------------vpss ext chn attr2--------------------------------------------------------------
grp ext_chn scale_type
----------------------------------------vpss chn low delay attr---------------------------------------------------------
grp chn enable line_cnt one_buf_en one_buf_addr act_low_delay_en
0 0 Y 200 N 0x0 Y
----------------------------------------vpss rgn info-------------------------------------------------------------------
grp cover mosaic corner overlay position
0 0 0 0 0 cur
----------------------------------------vpss grp stitch pipe status-----------------------------------------------------
grp pipe recv_pic preview_lost free_num busy_num overlap_point0x overlap_point1x
----------------------------------------vpss grp gdc status-------------------------------------------------------------
grp enable dis_en out_width out_height
0 N N 0 0
----------------------------------------vpss chn proc ex----------------------------------------------------------------
grp chn rotate cover_ex mosaic_ex line_ex corner_ex overlay_ex
0 0 N 0 0 0 0 0
----------------------------------------vpss node status----------------------------------------------------------------
grp free_num busy_num delay_num backup cur
0 9 0 0 0 0
----------------------------------------vpss grp work status------------------------------------------------------------
grp recv_pic preview_lost new_do old_do new_undo old_undo start_fail start cost_time max_cost_time vpss
0 308 0 308 0 0 0 0 Y 2002 2251 0
----------------------------------------vpss grp video frame info-------------------------------------------------------
grp width height pixel_fmt video_format dynamic_range cmp_mode recv_fmu first_pic_pts cur_pic_pts
0 3840 2160 YVU-SP420 LINEAR SDR8 SEG off 0 0
----------------------------------------vpss chn output status----------------------------------------------------------
grp chn enable width height pixel_fmt video_format dynamic_range cmp_mode send_ok frame_rate proc_time
0 0 Y 3840 2160 YVU-SP420 LINEAR SDR8 SEG 275 30 2029
----------------------------------------vpss drv work status------------------------------------------------------------
link_int bus_err dcmp_err frame_err malloc_err free_err start_suc0 start_err0 node_err0
308 0 0 0 0 0 308 0 0
----------------------------------------vpss hardware node queue--------------------------------------------------------
free_num wait_num proc_num sel00 busy000 busy001 sel01 busy010 busy011 load_ratio_0
22 0 0 0 0 0 0 0 0 52%
----------------------------------------vpss int work status------------------------------------------------------------
cnt_per_sec max_cnt_per_sec cost_time max_cost_time cost_time_per_sec max_cost_time_per_sec
61 61 73 191 5594 5942
我来回答
回答4个
时间排序
认可量排序
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片
相关问答
-
2020-06-07 11:54:56
-
2025-03-20 11:14:15
-
2020-12-24 14:29:32
-
2020-06-08 17:25:02
-
2016-11-06 23:18:26
-
2020-03-07 16:16:03
-
2021-01-14 11:46:44
-
2019-07-08 09:21:28
-
2025-01-06 18:27:15
-
2023-10-31 19:31:23
-
2020-05-28 11:46:40
-
2016-07-20 16:06:38
-
2024-11-27 17:31:44
-
2024-10-31 14:51:35
-
2016-06-06 14:43:36
-
2016-06-15 10:53:18
-
2020-07-03 09:28:56
-
2021-01-13 13:40:57
-
2025-01-13 21:13:57
无更多相似问答 去提问

点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
10海思3559的VGS模块在VI上画线问题
-
53519dv500接lvds的sensor mn34120,图像出现很多竖线,sensor板接以前的3519v101没问题
-
103403外接hdmi口1024*600显示屏报错
-
5SS928点DC camera的6946,全屏紫色
-
5hi3519 的 网络传输的MTU值可以修改到比1500大嘛?
-
10WS73V100星闪扫描不到设备sle
-
5SS928/SD3403 录像失败 venc stream time out, exit thread; venc 2 stream buffer is full
-
10Hi3516DV500无法运行PQTool软件
-
10君正T23+1084带TF卡插卡(给该主板适配TF卡驱动,电机驱动,适配GPIO)
-
5Hi3536A从vpss获取1080分辨率的yuv数据异常
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认