Git Product home page Git Product logo

evercam-discovery-java's Introduction

Network Discovery Library in Java

A network scanning library in Java for discovering IP cameras, includes IP scan, port scan, UPnP device discovery, ONVIF discovery and additional camera discovery for thumbnail and defaults (username, password, URLs). See the flow diagram for more logical details.

Help make it better

The entire Evercam codebase is open source, see details: http://www.evercam.io/open-source. We'd love to see your pull requests! For any bugs and discussions, please use Github Issues. Any questions or suggestions around Evercam, drop us a line: http://www.evercam.io/contact

Build

Build evercam-discovery jar file by ./gradlew build.

Build an executable jar file contaning all the dependencies by ./gradlew fatjar.

Usage

Directly add the jar file to the classpath, Java doc will be associated with it as well. (The default jar file does not contain dependencies) If you just want to run the discovery app run the command that follows:

java -jar evercam-discovery-all-VERSION.jar --verbose -ip YOUR_ROUTER'S_IP -m YOUR_NETWORK_MASK

Examples

Scan local network, find camera devices with options of including camera thumbnail and defaults or not, and return all discovered camera details(IP address, internal & external HTTP & RTSP ports, MAC address, vendor, model, thumbmnail, default username, password and URLs), currently only work for Android.

import io.evercam.network.*;

EvercamDiscover evercamDiscover = new EvercamDiscover()
				.withThumbnail(true) //Include thumbnail URL or not
				.withDefaults(true); //Include camera defaults or not

//Discover all cameras
ScanRange scanRange = new ScanRange("192.168.1.1", //router IP
                                    "255.255.255.0"); //subnet mask
ArrayList<DiscoveredCameras> cameraList = evercamDiscover.discoverAllAndroid(scanRange);

Alternatively, you can scan for specific device details seperately:

//Discover all active IP address in local network
IpScan ipScan = new IpScan(new ScanResult(){
	@Override
	public void onActiveIp(String ip)
	{
		//Do what you want to the active IP address
	}
});
ipScan.scanAll(scanRange);

//Check a MAC address is camera vendor or not, 
Vendor vendor = EvercamQuery.getCameraVendorByMac("11:22:33");
if(vendor != null)
{
	//is a camera vendor
}

//Scan active ports by IP adress
PortScan portScan = new PortScan(new PortScanResult(){
	@Override
	public void onPortActive(int port, int type)
	{
		//Do what you want to the active port
	}
});
portScan.start("192.168.1.10");

//Discover UPnP devices in local network with device callback
UpnpDiscovery upnpDiscovery = new UpnpDiscovery(new UpnpResult(){
	@Override
	public void onUpnpDeviceFound(UpnpDevice upnpDevice)
	{
		//Do what you want to the UPnP device
	});
upnpDiscovery.discoverAll();
ArrayList<UpnpDevice> deviceList = upnpDiscovery.getUpnpDevices();

//Retrieve NAT table
GatewayDevice gatewayDevice = new GatewayDevice("192.168.1.1");
ArrayList<NatMapEntry> mapEntries = gatewayDevice.getNatTableArray();

//ONVIF discovery
new OnvifDiscovery(){
	@Override
	public void onActiveOnvifDevice(DiscoveredCamera discoveredCamera)
	{
		onDeviceFound(discoveredCamera);
	}
}.probe();

Flow Diagram

Disovery Diagram

evercam-discovery-java's People

Contributors

giacobenin avatar liutingdu avatar marcoherbst avatar

Watchers

 avatar  avatar

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.