Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

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

    V Series
    1
    2
    1116
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      cruise33 LV 6 last edited by

      通过调用 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 Reply Last reply Reply Quote Share 0
      • C
        cruise33 LV 6 last edited by

        这样就可以了

        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 Reply Last reply Reply Quote Share 0
        • 1 / 1
        • First post
          Last post

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

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