linux设备上的Onvif 实现14: 修改子通道的配置数据

本文介绍了一个用于修改视频编码配置的函数及其使用方法。通过该函数可以实现视频分辨率、码率、帧率和编码格式的调整,并展示了具体的代码实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1  修改配置数据函数原型

SOAP_FMAC5 int SOAP_FMAC6 soap_call___ns8__SetVideoEncoderConfiguration(struct soap *soap, const char *soap_endpoint, const char *soap_action, struct _ns8__SetVideoEncoderConfiguration *ns8__SetVideoEncoderConfiguration, struct _ns8__SetVideoEncoderConfigurationResponse *ns8__SetVideoEncoderConfigurationResponse)

2 代码实例

/* 修改配置参数  */
    struct _ns8__SetVideoEncoderConfiguration setConfigReq;
    struct _ns8__SetVideoEncoderConfigurationResponse setConfigResponse;   
    setConfigReq.ForcePersistence = "true";       //永久保存数据,摄像头重启后不会丢失
    setConfigReq.Configuration = Configurations;  //修改子通道的配置参数

    /* 修改分辨率 */
    MyModifyResolution(&setConfigReq, &getOptionsResponse);

    /* 修改码率 */   
    MyModifyBitrateLimit(&setConfigReq, &getOptionsResponse);

    /* 修改帧率 */   
    MyModifyFrameRate(&setConfigReq, &getOptionsResponse);

    /* 修改编码格式 */   
    MyModifyEncoding(&setConfigReq, &getOptionsResponse);
   
    result = soap_call___ns8__SetVideoEncoderConfiguration(soap, deviceode->mediauri, NULL, &setConfigReq, &setConfigResponse);
    if(result==-1)       
    {
        printf("soap error: %d, %s, %s\n", soap->error, *soap_faultcode(soap), *soap_faultstring(soap));
        result = soap->error;
        return FALSE;     
    }
    else
    {
        printf(" SetVideoEncoderConfiguration  OK! \n");  

        deviceode->profile[channel].support=1;  //通过检查设置为支持
        deviceode->profile[channel].Width          = setConfigReq.Configuration->Resolution->Width;
        deviceode->profile[channel].Height         = setConfigReq.Configuration->Resolution->Height;
        deviceode->profile[channel].FrameRateLimit = setConfigReq.Configuration->RateControl->FrameRateLimit;
        deviceode->profile[channel].BitrateLimit   = setConfigReq.Configuration->RateControl->BitrateLimit;
        sleep(1); 
    }

3 命令及应答报文

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

快活林高老大

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值