Git Product home page Git Product logo

ponvif's People

Contributors

cycne avatar kuroneko-san avatar rickerd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ponvif's Issues

Errors when stream url

https://github.com/KuroNeko-san/ponvif/blob/master/class.ponvif.php#L187
Causes an error, when this is removed it works || array_key_exists('Fault', $response['Envelope']['Body'])

`Notice: Undefined index: Envelope in /Users/rick/Projects/onvif/vendor/matthewbaggett/php-onvif/lib/class.ponvif.php on line 187

Warning: array_key_exists() expects parameter 2 to be array, null given in /Users/rick/Projects/onvif/vendor/matthewbaggett/php-onvif/lib/class.ponvif.php on line 187`

Using RTSP

As your example code

<?php

require 'class.ponvif.php';

$onvif = new Ponvif();
$onvif->setUsername('admin');
$onvif->setPassword('password');
$onvif->setIPAddress('192.168.1.108');

// In some cases you need to set MediaUrl manually. You can find it in "XAddrs" key (see above).
// $onvif->setMediaUri('http://192.168.1.108:3388/onvif/device_service');

try
{
	$onvif->initialize();
	
	$sources = $onvif->getSources();
	$profileToken = $sources[0][0]['profiletoken'];
	$mediaUri = $onvif->media_GetStreamUri($profileToken);
	
	var_dump($mediaUri);
}
catch(Exception $e)
{
	
}

I Got RTSP string bellow
string(86) "rtsp://xx.xx.xx.xx:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1"

What should I do with this RTSP?

Start/Stop record command

Hi,

is there a method to start / stop record video to SD card camera ?
Is there a method to retrieve recorded video of camera

Thanks in adavance

System Upgrade Errors

I just upgraded my system to the latest version and I am now getting this error:
Undefined index: GetSystemDateAndTimeResponse in /srv/www/htdocs/onvif/ponvif/lib/class.ponvif.php
Can you help?

Discovery returns only 1 endpoint in array

Hello!

I have 5 Onvif IP-cameras in my network. They are detected with standard Onvif Device Manager and Onvifer mobile application. When I try to discover them with ponvif it returns only 1 element in response array. I set discovery timeout to 5 seconds but result is the same.

Please tell how to discover all the 5 cameras with one function call?

artem@artem-inspirion:~/Projects/ponvif$ php ./test_discover.php
Array
(
[0] => Array
(
[EndpointReference] => Array
(
[Address] => urn:uuid:74:73:36:01:99:73
)

        [Types] => dn:NetworkVideoTransmitter
        [Scopes] => onvif://www.onvif.org/type/video_encoder onvif://www.onvif.org/hardware/MDC-N4090 onvif://www.onvif.org/location/Europe/Kaliningrad onvif://www.onvif.org/name/MDC-N4090
        [XAddrs] => http://192.168.1.61/onvif/device_service
        [MetadataVersion] => 1540978103
        [IPAddr] => 192.168.1.61
    )

)

artem@artem-inspirion:~/Projects/ponvif$ php ./test_discover.php
Array
(
[0] => Array
(
[EndpointReference] => Array
(
[Address] => urn:uuid:00025000-0001-D001-5775-001323A00B67
)

        [Types] => dn:NetworkVideoTransmitter
        [Scopes] => onvif://www.onvif.org/Profile/Streaming onvif://www.onvif.org/name/IPN100HD-5110PIR-EU onvif://www.onvif.org/type/video_encoder onvif://www.onvif.org/type/audio_encoder onvif://www.onvif.org/location/ onvif://www.onvif.org/hardware/IPN100HD 
        [XAddrs] => http://192.168.1.103:80/onvif/device_service
        [MetadataVersion] => 144
        [IPAddr] => 192.168.1.103
    )

)

can not discover function

Hi can you help
i cant run function
require 'class.ponvif.php';
$onvif = new Ponvif();
$result = $onvif->discover();
print_r($result);

error
image

if change
image
it show
image

==> how to fix this problem

PHP4 hell

I was taking a look at how the lib. works but... it looks sooo bad.
Compared to the library of https://github.com/rockyjvec/Onvif this library works 100%.
Only the code is such a mess and i think also a bit overhead in some functions.

I want to remake it into PHP7 standards, do you have time to do this with me?
The other library is great and works with the WSDL from Onvif but for example getting a profiletoken is impossible for me, i can't seem to get the token what so ever.
And requesting the url for a snapshot just kills my ip-camera.

The other lib. look better but it just doesn't work for me.

One optimalisation what i would really like and it makes the lib. smaller is this;

<?xml version="1.0" encoding="UTF-8"?><e:Envelope xmlns:e="http:/....

If you can/want to help i would be so happy! :)

Ask for help

When I use the api of ptz_Stop,it will report an error.
The error is "Stop: Communication error".
I use the api,such as "$onvif->ptz_Stop($profileToken, 0, 0);".

Added media_GetSnapshotUri

Attached is a script.

file.txt

But i get this error:

exception 'Exception' with message 'GetSnapshotUri: Communication error' in /var/www/html/class.ponvif.php:290 Stack trace: #0 /var/www/html/test_discover.php(16): Ponvif->media_GetSnapshotUri('Profile_1') #1 {main}

Double checked the XML and with Wireshark, the XML is correct but the validator fails.

Discovery need multicast route

If you are having problems with discovery:

root@linux-box$ php test_discover.php
PHP Warning: socket_set_option(): unable to set socket option [19]: No such device in lib/class.ponvif.php on line 142
PHP Warning: socket_sendto(): unable to write to socket [101]: Network is unreachable in lib/class.ponvif.php on line 143

-> You need to add the route to multicast:
root@linux-box$ route add -net 224.0.0.0 netmask 240.0.0.0 eth0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.