2 years ago
#40784
fpgaboy
Use onvif to switch video encoding between H265 and H264
I have obtained the H264 and H265 RTSP addresses of the webcam through onvif, now
I want to switch the video coding of the webcam through Onvif, may I ask what I should do?
Now, I use media2 SetVideoEncoderConfiguration to switch camera coding, function can be realized, but onvif gsoap in error, and not every support onvif webcam in this way can, what do I need to solve?
if(ns9__SetVideoEncoderConfiguration.Configuration->Encoding==NULL)
{
if(strcmp(piencoder,"H264") == 0)
{
ns9__SetVideoEncoderConfiguration.Configuration>Encoding=soap_strdup(psoap,"H264");
}
else
{
ns9__SetVideoEncoderConfiguration.Configuration->Encoding=soap_strdup(psoap, "H265");
}
}
soap_wsse_add_UsernameTokenDigest(soap, "user", m_strUserName.c_str(), m_strPassword.c_str());
int rv = soap_call___tr2__SetVideoEncoderConfiguration(soap, soap_endpoint, soap_action,
tr2__SetVideoEncoderConfiguration, tr2__SetVideoEncoderConfigurationResponse);
if (rv==0)
{
cout<<__FUNCTION__<<" success."<<endl;
return 0;
}
else
{
cout<<__FUNCTION__<<" failed,rv:"<<rv<<",soaperrorstr:"<<soaperrorstr(soap)<<endl;
return -1;
}
Media2SetVideoEncoderConfiguration failed,rv:-1,soaperrorstr: soap error: -1 ,faultcode: ,faultstring:
c++
h.264
0 Answers
Your Answer