{"id":37016342,"url":"https://github.com/hyeon-mogu/onvif-java","last_synced_at":"2026-01-14T01:50:33.944Z","repository":{"id":324621759,"uuid":"1068328794","full_name":"Hyeon-moGu/onvif-java","owner":"Hyeon-moGu","description":"Java ONVIF library for discovering, controlling, and managing IP cameras (PTZ, imaging, presets, Asynchronous)","archived":false,"fork":false,"pushed_at":"2025-11-18T23:32:22.000Z","size":91,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-20T14:14:07.401Z","etag":null,"topics":["async","camera-control","ipcamera","onvif","onvif-client","ptz"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hyeon-moGu.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-02T08:07:31.000Z","updated_at":"2025-12-09T02:11:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Hyeon-moGu/onvif-java","commit_stats":null,"previous_names":["hyeon-mogu/onvif-java"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Hyeon-moGu/onvif-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hyeon-moGu%2Fonvif-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hyeon-moGu%2Fonvif-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hyeon-moGu%2Fonvif-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hyeon-moGu%2Fonvif-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hyeon-moGu","download_url":"https://codeload.github.com/Hyeon-moGu/onvif-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hyeon-moGu%2Fonvif-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","camera-control","ipcamera","onvif","onvif-client","ptz"],"created_at":"2026-01-14T01:50:33.325Z","updated_at":"2026-01-14T01:50:33.939Z","avatar_url":"https://github.com/Hyeon-moGu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ONVIF Java Client: **Asynchronous Library** for **IP Camera Control**\n\nThis is a **lightweight, asynchronous Java client library** designed to simplify communication with **ONVIF-compliant IP cameras** and network video devices. By handling the complexity of the SOAP/XML protocol internally, this library allows developers to integrate robust camera control (PTZ, Imaging, Device Management) into their Java applications using simple, non-blocking method calls.\n\n**Beyond Simple Control**: While the library is designed for simple control using OnvifDevice objects, you also have the flexibility to make direct requests using a device's XAddr (web service address) and Token information when necessary.\n\n**Asynchronous Processing**:\nA core design principle of this library is non-blocking asynchronous operation.\n\n---\n\n### ✅ Tested On\n* **Vendor:** UNIVIEW\n* **Model:** IPC6222ER-X20\n* **Firmware:** IPC_HCMN1102-R5028P07D1603C02\n\n---\n\n## Installation\n\n### Maven:\n\n```Java\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.hyeon-mogu\u003c/groupId\u003e\n    \u003cartifactId\u003eonvif-java\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle:\n\n```Java\nimplementation group: 'io.github.hyeon-mogu', name: 'onvif-java', version: '1.0.2'\n```\n\n---\n\n## Key Features\n\n- **Standard WS-Security Authentication**: Securely authenticates using the WS-Security (Username Token Profile) Password Digest method, adhering to the strict ONVIF standard.\n\n- **Asynchronous \u0026 Non-Blocking**: Non-blocking callback mechanism ensures application responsiveness during network operations.\n\n- **ONVIF Device Discovery**: Automatically detects and connects to ONVIF-compliant IP cameras on the local network.\n\n- **Comprehensive PTZ Control**: Full support for real-time Pan/Tilt/Zoom movements and Stop functionality.\n\n- **PTZ Preset Management**: Comprehensive preset management including saving positions (Save), moving to saved positions (Goto), retrieving the full list of presets (GetPresets), and deleting existing presets (Remove).\n\n- **PTZ Status Inquiry**: Retrieve the camera's current PTZ position, move status (e.g., IDLE/MOVING), and current UTC time.\n\n- **Advanced Imaging Control**: Set and retrieve detailed camera parameters like Brightness, Exposure, Focus, and WDR.\n\n- **Device \u0026 Media Management**: Retrieve essential information, including Device Information, Media Profiles, and Snapshot URIs.\n\n---\n\n## Code Example\n\n### DiscoveryManager\n\n```java\nDiscoveryManager discoveryManager = new DiscoveryManager();\ndiscoveryManager.setDiscoveryTimeout(30000); // Set timeout (30 seconds)\n\ndiscoveryManager.discover(new DiscoveryListener() {\n\t@Override\n\tpublic void onDiscoveryStarted() {\n\t\tlogger.info(\"Discovery started...\");\n\t}\n\n\t@Override\n\tpublic void onDevicesFound(List\u003cDevice\u003e devices) {\n\t\tfor(Device dv : devices) {\n\t\t\tlogger.info(\"Found Device: {}\", dv.getHostName());\n\t\t}\n\t}\n    // Error handling goes in onError()\n});\n```\n\n---\n\n### OnvifManager\n\n```java\nOnvifManager onvifManager = new OnvifManager();\n\nonvifManager.getCapabilities(onvifDevice, new OnvifCapabilitiesListener() {\n\t\n\t@Override\n\tpublic void onDeviceCapabilitiesReceived(OnvifDevice onvifDevice, OnvifCapabilities onvifCapabilities) {\n\t\tlogger.info(\"Device XADDR: {}\", onvifCapabilities.getXaddr());\n\t\tlogger.info(\"Device MaxProfiles: {}\", onvifCapabilities.getMaximumNumberOfProfiles());\n\t\t\n\t}\n});\n\nonvifManager.getMediaProfiles(onvifDevice, new OnvifMediaProfilesListener() {\n\n\t@Override\n\tpublic void onMediaProfilesReceived(OnvifDevice device, List\u003cOnvifMediaProfile\u003e mediaProfiles) {\n\t\tOnvifMediaProfile omp = mediaProfiles.get(0);\t//example\n\n\t\tonvifManager.getSnapshotURI(device, omp, new OnvifSnapshotURIListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onMediaSnapshotReceived(OnvifDevice device, OnvifMediaProfile profile, String uri) {\n\t\t\t\tlogger.info(\"==== Snapshot Uri: {}\", uri);\n\t\t\t}\n\t\t});\n\t}\n});\n\n// GetDeviceInformation, GetMediaStreamURI, GetServices, etc..\n```\n\n---\n\n### PTZManager(PTZ operation)\n\n```java\nPtzManager ptzManager = new PtzManager();\n\n// Pan/tilt\nptzManager.move(onvifDevice, PtzType.UP_RIGHT, new PtzResponseListener() {\n\t\n\t@Override\n\tpublic void onResponse(PtzResponse ptzResponse) {\n\t\tlogger.info(\"PTZ result: {}\", ptzResponse.getMessage());\n\t\tlogger.info(\"PTZ boolean: {}\", ptzResponse.isSuccess());\n\t\t// etc . .\n\t}\n});\n\n// Zoom\nptzManager.move(onvifDevice, PtzType.ZOOM_IN, new PtzResponseListener() {\n\t\n\t@Override\n\tpublic void onResponse(PtzResponse ptzResponse) {\n\t\t// ptzResponse..\n\t}\n});\n\n// Stop\nptzManager.stop(onvifDevice, new PtzResponseListener() {\n\t\n\t@Override\n\tpublic void onResponse(PtzResponse ptzResponse) {\n\t\t// ptzResponse..\n\t}\n});\n```\n\n---\n\n### PTZManager(Preset operation)\n\n```java\nPresetCommand pcGet = new PresetCommand(PresetAction.GET, null);\nptzManager.preset(onvifDevice, pcGet, new PtzResponseListener() {\n\n\t@Override\n\tpublic void onResponse(PtzResponse ptzResponse) {\n\t\tlogger.info(\"Preset GET result: {}\", ptzResponse.getMessage()); \n\t}\n});\n\nPresetCommand pcSave = new PresetCommand(PresetAction.SAVE, \"example\");\nptzManager.preset(onvifDevice, pcSave, new PtzResponseListener() {\n\n\t@Override\n\tpublic void onResponse(PtzResponse ptzResponse) {\n\t\tlogger.info(\"Preset SAVE result xml: {}\", ptzResponse.getRawXml());\n\t\t// etc . .\n\t}\n});\n\nPresetCommand pcMove = new PresetCommand(PresetAction.MOVE, \"example\");\nptzManager.preset(onvifDevice, pcMove, new PtzResponseListener() {\n\n\t@Override\n\tpublic void onResponse(PtzResponse ptzResponse) {\n\t\tlogger.info(\"Preset MOVE result xml: {}\", ptzResponse.getRawXml());\n\t\t// etc . .\n\t}\n});\n```\n\n---\n\n### PTZManager(Status Inquiry)\n\n```java\nPtzManager ptzManager = new PtzManager();\n\nptzManager.getStatus(onvifDevice, new PtzResponseListener() {\n\t\n\t@Override\n\tpublic void onResponse(PtzResponse ptzResponse) {\n\t\tlogger.info(\"PTZ Status result: {}\", ptzResponse.getMessage());\n\t\t// Message: Position: (Pan: 0.1, Tilt: 0.2, Zoom: 0.0), MoveStatus: (PanTilt: IDLE, Zoom: IDLE), Time: ...\n\t}\n});\n```\n\n---\n\n### ImagingManager\n\n```java\nImagingManager imagingManager = new ImagingManager();\n\nImagingSettings settingsToUpdate = new ImagingSettings();\nsettingsToUpdate.setBrightness(128); // Set a specific value\nsettingsToUpdate.setExposureMode(\"AUTO\"); // Set an enumeration value\n\n// Set Imaging Settings\nimagingManager.setImagingSettings(onvifDevice, settingsToUpdate, new ImagingSettingRequestListener() {\n\t@Override\n\tpublic void onResponse(ImagingResponse imagingResponse) {\n\t\tlogger.info(\"Imaging settings updated result xml: {}\", imagingResponse.getXml());\n\t}\n});\n\n// Get Imaging Settings\nimagingManager.getImagingSettings(onvifDevice, new ImagingSettingsListener() {\n\n\t@Override\n\tpublic void onResponse(OnvifDevice onvifDevice, ImagingSettings imagingSettings) {\n\t\tlogger.info(\"All ImagingSettings: {}\", imagingSettings.toString());\n\t}\n});\n\n// Continuous Focus\nimagingManager.focusContinuousMove(onvifDevice, 0.5, new ImagingFocusResponseListener() {\n\t\n\t@Override\n\tpublic void onResponse(ImagingResponse imagingResponse) {\n\t\tlogger.info(\"Focus boolean: {}\", imagingResponse.isSuccess());\n\t}\n});\n```\n\n---\n \n## Requirements\n\n- **Java 8 or higher**  \n- An **ONVIF-compliant network camera**  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyeon-mogu%2Fonvif-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyeon-mogu%2Fonvif-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyeon-mogu%2Fonvif-java/lists"}