330
- 收藏
- 点赞
- 分享
- 举报
求助 RV1126 VMIX的使用方法或者绘制多个框的方法
目前已经可以实现用RK_MPI_VENC_RGN_SetBitMap来绘制字符,但如果需要绘制多个框,需要共用一个region,每次后续添加或删除框都需要重新绘制bitmap,在计算上来说有些麻烦。
原流程:VI->VENC(OSD->VENC_RGN)->rtsp
增加VMIX:VI->VMIX->VENC(OSD->VENC_RGN)->rtsp
查阅文档发现VMIX有个接口RK_MPI_VMIX_SetLineInfo,需要有两个码流0和1,打印显示码流0成功绑定了,调用这个接口也没有绘制出框,而且码流1报错”RK_MPI_SYS_Bind Dst Mode[VMIX]:Chn[1] is not ready!”
求助各位大佬有没有用过VMIX的经验或者绘制多个框的方法,万分感谢!
////////////
ret = RK_MPI_VI_SetChnAttr(0, stream_id, &vi_chn_attr);
ret |= RK_MPI_VI_EnableChn(0, stream_id);
////////////
ret = RK_MPI_VENC_CreateChn(stream_id, &chn_attr);
////////////
int vmix_init(int stream_id, int width, int height)
{
VMIX_DEV_INFO_S stDevInfo;
stDevInfo.enImgType = IMAGE_TYPE_NV12;
stDevInfo.u16ChnCnt = 1;
stDevInfo.u16Fps = 15;
stDevInfo.u32ImgWidth = width;
stDevInfo.u32ImgHeight = height;
stDevInfo.bEnBufPool = RK_TRUE;
stDevInfo.u16BufPoolCnt = 3;
stDevInfo.stChnInfo[0].enImgInType = IMAGE_TYPE_NV12;
stDevInfo.stChnInfo[0].enImgOutType = IMAGE_TYPE_NV12;
stDevInfo.stChnInfo[0].stInRect.s32X = 0;
stDevInfo.stChnInfo[0].stInRect.s32Y = 0;
stDevInfo.stChnInfo[0].stInRect.u32Width = width;
stDevInfo.stChnInfo[0].stInRect.u32Height = height;
stDevInfo.stChnInfo[0].stOutRect.s32X = 0;
stDevInfo.stChnInfo[0].stOutRect.s32Y = 0;
stDevInfo.stChnInfo[0].stOutRect.u32Width = width;
stDevInfo.stChnInfo[0].stOutRect.u32Height = height;
int ret = RK_MPI_VMIX_CreateDev(stream_id, &stDevInfo);
if (ret)
{
PRINT_WARN("Init VMIX device failed! ret=%d\n", ret);
return -1;
}
ret = RK_MPI_VMIX_EnableChn(stream_id, 0);
if (ret)
{
PRINT_WARN("Enable VM[0]:Chn[0] failed! ret=%d\n", ret);
return -1;
}
PRINT_INFO("create vm[%d] success\n", stream_id);
return 0;
}
int chn_bind(int stream_id)
{
assert(stream_id <= MAX_MEDIA_STREAM_CNT);
MPP_CHN_S stSrcChn;
stSrcChn.enModId = RK_ID_VI;
stSrcChn.s32DevId = 0;
stSrcChn.s32ChnId = stream_id;
MPP_CHN_S stDestChn;
stDestChn.enModId = RK_ID_VMIX;
stDestChn.s32DevId = 0;
stDestChn.s32ChnId = stream_id;
int ret = RK_MPI_SYS_Bind(&stSrcChn, &stDestChn);
if (ret)
{
PRINT_WARN("ERROR: Bind VI[%d] and VMIX[%d] error! ret=%d\n", stream_id, stream_id, ret);
return -1;
}
PRINT_INFO("Bind VI[%d] and VMIX[%d] success\n", stream_id, stream_id);
stSrcChn.enModId = RK_ID_VMIX;
stSrcChn.s32DevId = 0;
stSrcChn.s32ChnId = stream_id;
stDestChn.enModId = RK_ID_VENC;
stDestChn.s32DevId = 0;
stDestChn.s32ChnId = stream_id;
ret = RK_MPI_SYS_Bind(&stSrcChn, &stDestChn);
if (ret)
{
PRINT_WARN("ERROR: Bind VMIX[%d] and VENC[%d] error! ret=%d\n", stream_id, stream_id, ret);
return -1;
}
PRINT_INFO("Bind VMIX[%d] and VENC[%d] success\n", stream_id, stream_id);
RK_MPI_SYS_SetMediaBufferDepth(RK_ID_VENC, stream_id, 3);
return -1;
}
我来回答
回答1个
时间排序
认可量排序
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2017-01-20 09:14:08
-
2022-11-18 16:15:25
-
2018-11-16 13:07:10
-
2008-09-10 10:52:48
-
2019-11-21 11:41:09
-
2023-11-20 21:35:24
-
2013-11-19 13:16:54
-
2018-11-16 13:05:40
-
2018-11-15 22:44:52
-
2013-11-29 22:31:33
-
2020-11-10 18:05:58
-
2021-06-21 16:08:30
-
2016-01-25 15:05:45
-
2022-09-13 12:03:56
-
2017-12-13 15:53:56
-
2015-12-03 18:11:34
-
2017-01-03 10:06:13
-
2013-01-26 16:47:22
-
2021-08-09 17:24:02
无更多相似问答 去提问
![易百纳技术社区](/img/web/quest_unlogin_avatar.png)
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5SS928V100使用PQTools推流至VLC失败
-
10Hi3516CV610安装SDK时编译BSP问题
-
25Hi3516DV500运行PQTools.sh报错问题
-
5自定义算子DecBBox中的参数如何设置
-
5SS928 host_uvc例子读usb相机问题
-
10RV1126 ffmpeg rkmedia vdec 播放器,播放本地mp4问题
-
5RV1126 201型串口连接之后没有打印输出
-
5RV1126开发板能否接4路摄像头?
-
25Linux交叉编译Qt,适配opengl,构建报错
-
50rv1126 鱼眼矫正失败,“FEC MeshXY.bin open error!!!”
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认