Closed tssk closed 5 years ago
Hardcoding camera live stream URL in lib/onvif-device.js by changing line 244
from:
'-i', this.streamUrl.toString(),
to:
'-i', 'rtsp://admin:12345@192.168.1.206:5544/live1.264',
(and updating SHA256 cheksum for the lib/onvif-device.js file )
makes it work like a charm.
So where does profile.StreamUri.Uri
come from? (I am sorry I am JavaScript illiterate.)
In lib/onvif-device.js
, can you change the DEBUG
flag at the top to be true
? After doing so, it will dump the streaming profile to the log. The URI is part of that profile.
Oh, thanks!
2019-07-09 18:47:20.789 INFO : onvif: "StreamUri": {
2019-07-09 18:47:20.790 INFO : onvif: "Uri": "rtsp://192.168.1.206:5544/live0.264",
2019-07-09 18:47:20.791 INFO : onvif: "InvalidAfterConnect": "false",
2019-07-09 18:47:20.792 INFO : onvif: "InvalidAfterReboot": "false",
2019-07-09 18:47:20.793 INFO : onvif: "Timeout": "PT10S"
2019-07-09 18:47:20.794 INFO : onvif: },
It looks correct... So the problem must be somewhere in the ffmpeg processing I guess. I will investigate that thanks!
If you reset the URL back to the original this.streamUrl.toString()
, you can check the output of ps -ef
to see the full ffmpeg
command that's running.
So it seems the problem is that the camera default settings of hi-resolution/definition stream is producing "invalid VUI" ( source https://superuser.com/a/1421470 ). Changing the hires stream resolution setting from 1920x1080 to 1280x720 makes it work ok. ( Other option is to patch ffmpeg. )
So much for "cheap chinese camera"... :)
To sum up - to get the camera working:
Thanks for your time @mrstegeman !
Tomas
Great! Glad it's working for you.
Hello,
I was amazed when I found this Mozilla IOT Gateway Add-on for cameras! Please consider this as a feature request/request for help/sharing of experience.
I am trying to get this working with "cheap chinese HD IP camera". Based on this https://www.jpavlik.cz/aliexpress-ip-cameras-review/ blog post I decided to try Revotech I6032, specifically I6032W-V200-POE (white, non-sony chip, PoE).
I am using Mozilla IOT Gateway 0.8.1 installed on Debian 9 in virtualbox according to official procedure on github. Then I installed ffmpeg from debian package. And added ONVIF Add-on and it correctly autodetected camera IP (192.168.1.206). I had to set password for the default admin user because the Add-on does not seem to allow empty password. After setting the password Gateway was able to detect and add Video Camera Thing.
Screenshot works ok. Stream does not work.
I can view the lowres stream manually using
$ ffplay rtsp://admin:12345@192.168.1.206:5544/live1.264
(hires should be /live0.264 ) so I guess adding some correct parameters in lib/onvif-device.js should do the trick?Maybe more generally allow manual configuration for stream url to support more cameras?
I would like to try to add support myself but I will sure need some help/advice where to start.
Thanks,
Tomas