导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    请教下rt-media的切换彩色/黑白模式

    V Series
    1
    2
    593
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • C
      cruise33 LV 6 最后由 编辑

      通过调用 AWVideoInput_SetIrParam 函数来切换黑白模式是正常的,但是再切回彩色模式,却不起作用,yuv仍然是黑白的,请问是哪里的问题呢?我看demo_video_in.c也是这么用的

      	/* 切换 彩色/黑白 模式 */
      	static RTIrParam pIrParam = {0};
      	if(res.faces->isLive == 0){
      		if(pIrParam.grey == 0){
      			printf("set IR\n");
      			pIrParam.grey = 1;
      			pIrParam.ir_on = 1;
      			pIrParam.ir_flash_on = 1;
      			int ret = AWVideoInput_SetIrParam(config->channelId, &pIrParam);
      			if(ret < 0)
      				printf("set IR error\n");
      		}
      	}else{
      		if(pIrParam.grey == 1 && frame_cnt == 50){
      			printf("set RGB\n");
      			pIrParam.grey = 0;
      			pIrParam.ir_on = 0;
      			pIrParam.ir_flash_on = 0;
      			int ret = AWVideoInput_SetIrParam(config->channelId, &pIrParam);
      			if(ret < 0)
      				printf("set RGB error\n");
      		}
      	}
      
      1 条回复 最后回复 回复 引用 分享 0
      • C
        cruise33 LV 6 最后由 编辑

        这样就可以了

        int ISP_RGB_GREY(int chnID, int Grey)
        {
        	RTIspCtrlAttr isp_ctrl_attr;
        	if(Grey == 0){
        		isp_ctrl_attr.isp_attr_cfg.cfg_id = RT_ISP_CTRL_IR_STATUS;
        		isp_ctrl_attr.isp_attr_cfg.ir_status = 0;
        	}
        	else{
        		isp_ctrl_attr.isp_attr_cfg.cfg_id = RT_ISP_CTRL_IR_STATUS;
        		isp_ctrl_attr.isp_attr_cfg.ir_status = 1;
        	}
        	AWVideoInput_SetIspAttrCfg(chnID, &isp_ctrl_attr);
        	usleep(500*1000);
        	return 0;
        }
        
        1 条回复 最后回复 回复 引用 分享 0
        • 1 / 1
        • First post
          Last post

        Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

        行为准则 | 用户协议 | 隐私权政策