Open mhl787156 opened 5 years ago
There are a couple things to note here.
If you'd like to play with the ffmpeg
options, you can do the following:
cd ~/.mozilla-iot/addons/onvif-adapter
mkdir .git
(this gets around checksum issues)lib/onvif-device.js
. See code here: https://github.com/mozilla-iot/onvif-adapter/blob/master/lib/onvif-device.js#L242-L308I would love to see performance tweaks if you can come up with some. I played around a lot with ffmpeg options and this seemed like a reasonable set.
Thanks for your anwser! That's really useful to know and I'll have a go at playing around with ffmpeg and some settings later and let you know how I get on! As far as I understand, there's no tunnelling right now as its all on the local network.
A couple of things I noticed last night after posting was that the camera itself has a bunch of settings (bitrate, max frame rate, key frame interval, bit rate control) which i'll keep on tweaking, but it also has a second lower resolution stream (640x352) which might actually stream better than the high res stream (1920x1080). Perhaps it might be worth adding the option to switch streams on lower connections?
The other thing I noticed was that iSpy seems to be ~40 seconds behind which seems to me like they may be doing something more behind the scenes rather than just displaying the stream results, im not sure.
Ill have a play around and see what I can come up with!
On a different note, UI wise, Imo having a snap-shot button on the video streaming page would be a nice addition! Currently its hard to know what you are snap-shotting! Also in your installation instructions, its good to know that the default ffmpeg on apt-get is actually version 2.8, rather than ffmpeg 4/4.1 which is required on your project! It would be useful to make that clear for others possibly - that got me stuck for a bit on setup! :)
It's been my experience that the ONVIF standard allows cameras to list a set of preconfigured profiles that can be selected. If I can figure out a good way to present those to the user, maybe I can add a "Profile" property. In the meantime, you could probably just set the camera to something lower and see if that helps your streaming performance.
As for ffmpeg, the add-on should detect versions properly. For instance, on my MacBook, I have version 4.1, but on the Raspberry Pi, I have 2.8. The add-on works properly on both, as it checks the version and only uses options which are valid for the installed version.
I like the idea of the snapshot button. I've also considered adding a snapshot action, which could be taken by a rule. However, we've been struggling to find a decent way to present all those snapshots to the user, and let the user manage them. Ideas?
I'm testing this sytem with an ONVIF camera I bought off Amazon, almost all seems to be working (onvif discovery, connection, adding of the device). The only thing that isn't is that the streamed camera footage is very choppy and intermittent with buffering occurring every 2-30 seconds.
This occurs on both chrome and developer firefox. It does not appear to be a streaming issue as I have been getting a consistent 10-15fps when streaming using the ISpy desktop application. Logs dont seem to show anything of interest either.
The gateway is running on my home linux server running Ubuntu 16.04 with ffmpeg 4.1 installed. Do you have any thoughts on what could be causing this? Cheers!