rockyjvec / Onvif

PHP Onvif library for IP cameras.
20 stars 15 forks source link

Unable to get stream uri because of soap validation constraint violation #5

Open tozman51 opened 3 years ago

tozman51 commented 3 years ago

On a PTZ camera, I can get Presets, send presets etc, but I didn't manage to get the stream URI unfortunately, despite spending hours tinkering with the library and checking the ONVIF specs...

Here is how I ask for streams :

$o = new Rockyjvec\Onvif\Onvif("http://192.168.1.47:81/onvif/device_service", "admin", "password");
$o->media->GetProfiles();

$params = [
            'StreamSetup'=>
                [   
                    'Stream'=>'RTP-Unicast',
                    'Transport'=>
                        [
                            'Protocol'=>'RTSP'
                        ]
                ],
                'ProfileToken' => 'profile_cam1_stream1'
          ];

print_r($o->media->GetStreamUri($params));

And here is the output :

PHP Fatal error: Uncaught SoapFault exception: [s:Client] Validation constraint violation: empty value provided where a value is required in element 'SOAP-ENC:Struct' in /home/nicolas/Projets/onphp/vendor/rockyjvec/onvif/src/Rockyjvec/Onvif/Soap/SoapClient.php:75

If someone passes by and succesfully cot their camera stream uri :) any help is welcome.