Commit Graph

2244 Commits

Author SHA1 Message Date
seydx efc5eff40f Refactor timestamp handling in buildFrame and AddTrack functions to use microseconds 2026-03-21 13:48:25 +03:00
seydx 262a571a84 add webcodecs support 2026-03-21 13:48:25 +03:00
Sergey Krashevich c90480a40c Merge branch 'master' into dev 2026-03-21 11:02:11 +03:00
Alex X dc1685e9cf Merge pull request #2159 from ludufre/fix/mpegts-pcma-pcmu-probe
Add support PCMATapo for MPEG-TS source
2026-03-17 17:29:03 +03:00
Luan Freitas 65af579770 fix: remove PCMU, keep only PCMA (always 8000 Hz per G.711 spec) 2026-03-17 10:27:23 -03:00
Sergey Krashevich 6482373aa3 chore(build): add dev branch to build workflow - include 'dev' branch to trigger builds alongside 'beta' docs(README): update binary download links to dev builds - change links to point to nightly builds for development binaries 2026-03-17 04:36:04 +03:00
Sergey Krashevich d6a4d1e8e0 docs(README): update change log to include latest PR 2159 - add entry for PR 2159 regarding PCMA and PCMU handling by @ludufre 2026-03-17 04:27:13 +03:00
Sergey Krashevich 107924d2f7 Merge pull request #2159 from ludufre/fix/mpegts-pcma-pcmu-probe 2026-03-17 04:13:14 +03:00
Luan Freitas d9af354de8 fix: add PCMU to StreamType() mapping 2026-03-16 20:23:01 -03:00
Luan Freitas 31c19a0e7d fix: incoming pcma and pcmu 2026-03-16 18:33:01 -03:00
Sergey Krashevich 8f3be3050b docs(README): add section for merged PRs not yet in master 2026-03-11 13:38:31 +03:00
Sergey Krashevich 6a968c8595 docs(README): update Docker image references from skrashevich to AlexxIT for consistency 2026-03-11 13:30:34 +03:00
Sergey Krashevich cc5f177314 Merge pull request #2147 from skrashevich/beta
dev branch: merge from skrashevich/go2rtc:beta
2026-03-11 12:02:11 +03:00
Sergey Krashevich f1d4baa5d0 docs(README): update features and improvements sections - add WebUI enhancements and clarify system resource monitoring details 2026-03-11 02:17:42 +03:00
Sergey Krashevich 5d6b4911ff docs(README): add screenshots and update image references - include dark and light theme screenshots for various app components - update image links in the documentation for consistency feat(package): add playwright as a dependency - include playwright for end-to-end testing capabilities 2026-03-11 02:13:15 +03:00
Sergey Krashevich 27b04ed9d8 style(links, add, index, info, probe, log, main, styles): update styles and improve layout - refactor button and input styles for consistency across pages - enhance responsive design for better usability on mobile devices - adjust spacing and margins for a cleaner look - unify color scheme and hover effects for links and buttons - remove unused font imports to optimize loading performance 2026-03-11 02:12:52 +03:00
Sergey Krashevich 5fced9a580 Update README files to reflect new Docker image naming and features in the fork 2026-03-11 00:24:33 +03:00
Sergey Krashevich d4c2721d1c Update Go version to 1.26 in workflows and Dockerfiles 2026-03-11 00:17:31 +03:00
Sergey Krashevich 9f5a4b2d96 Publish to GHCR only; remove DockerHub logins
Simplify CI container publishing by targeting only GitHub Container Registry. The docker/metadata-action images inputs for meta, meta-hw and meta-rk jobs were changed to ghcr.io/${{ github.repository }} (removing DockerHub image entries). DockerHub login steps were removed, and the GHCR login now runs for all non-pull_request events (if: github.event_name != 'pull_request'). Changes are in .github/workflows/build.yml to avoid pushing to DockerHub and ensure GHCR auth runs on appropriate events.
2026-03-11 00:15:37 +03:00
Sergey Krashevich 002070991c Merge remote-tracking branch 'origin/251221-webui-redisign' into beta
# Conflicts:
#	www/index.html
#	www/links.html
#	www/main.js
2026-03-11 00:02:12 +03:00
Sergey Krashevich 072cdd7c44 Merge remote-tracking branch 'origin/260201-readonly' into beta
# Conflicts:
#	README.md
#	www/index.html
2026-03-10 23:58:57 +03:00
Sergey Krashevich e59b17d77d Merge remote-tracking branch 'origin/260216-include-js-to-docker' into beta 2026-03-10 23:56:49 +03:00
Sergey Krashevich 7208e33aeb Merge remote-tracking branch 'origin/260213-add-pid-to-api' into beta 2026-03-10 23:56:45 +03:00
Sergey Krashevich 2141cce5e0 Merge remote-tracking branch 'origin/260213-fix-schemas-race-condition' into beta 2026-03-10 23:56:37 +03:00
Sergey Krashevich 21b9b49c06 Merge remote-tracking branch 'origin/260210-fix-yaml-patch-merge' into beta 2026-03-10 23:56:30 +03:00
Sergey Krashevich 256befb592 Merge branch 'go-webp' into beta
# Conflicts:
#	.gitignore
#	go.sum
2026-03-10 23:54:17 +03:00
Sergey Krashevich 1f2396e278 Merge branch 'hksv' into beta
# Conflicts:
#	pkg/hap/hds/hds_test.go
2026-03-10 23:53:40 +03:00
Sergey Krashevich 2b7682cdb3 refactor(dvrip): simplify broadcast loop structure
- replace traditional for loop with range-based for loop for clarity

refactor(ffmpeg): simplify cut function loop
- utilize range-based for loop instead of traditional for loop

refactor(ring): update API response mapping type
- change map type from `interface{}` to `any` for better type safety

refactor(stream): handle nil source in NewStream
- add nil check for source elements before processing

refactor(webrtc): unify payload handling in GetToken
- change map type from `interface{}` to `any` for consistency

refactor(ascii): optimize nested loops in Write function
- replace traditional for loops with range-based for loops for readability

refactor(bits): enhance readability in Reader methods
- replace traditional for loops with range-based for loops in Read functions

refactor(h264): modernize loop structures in DecodeConfig
- switch to range-based for loops for cleaner code

refactor(h265): streamline profile_tier_level loops
- utilize range-based for loops instead of traditional for loops

chore(core): remove commented-out test function for clarity

refactor(core): simplify RandString function loop
- change traditional for loop to range-based for loop

refactor(flvt): optimize timestamp handling in TestTimeToRTP
- switch to range-based for loop for iterating frames

refactor(nest): improve error handling in ExchangeSDP
- format error message with printf-style formatting for clarity

refactor(tapo): enhance securityEncode function
- change traditional for loop to range-based for loop for readability

fix(tcp): correct masking in websocket Write method
- replace traditional for loop with range-based for loop

refactor(tutk): modernize encoding loops in crypto functions
- utilize range-based for loops for better readability

refactor(tuya): unify data types in MQTT message struct
- change map type from `interface{}` to `any` for consistency

refactor(webrtc): standardize codec registration
- change map type from `interface{}` to `any` for type safety

refactor(yaml): simplify Unmarshal function signature
- update parameter type from `interface{}` to `any` for better clarity
2026-03-10 23:26:45 +03:00
Sergey Krashevich 319fc3a154 Update Go version to 1.26.1 and remove unused dependencies 2026-03-10 23:03:22 +03:00
Sergey Krashevich f435b49652 chore(go.mod): remove unused dependencies - delete github.com/asticode/go-astits and github.com/asticode/go-astikit from go.mod and go.sum to clean up unused imports - update the project dependencies for better maintainability 2026-03-10 22:56:42 +03:00
Sergey Krashevich 0d8d4c204d fix(go.mod, go.sum): update go-webp dependency to v0.1.0 2026-03-10 22:54:14 +03:00
Sergey Krashevich ea03aa832d feat(webp): add WebP streaming and snapshot APIs
- implement WebP streaming with multipart support
- add snapshot endpoint for WebP format with quality options
- introduce WebP encoding using pure Go library without FFmpeg
- update documentation and links for new WebP features
2026-03-10 22:43:29 +03:00
Sergey Krashevich 506cfa7df5 fix(.gitignore): add .omc to ignore list and ensure .ruff* is properly included 2026-03-10 22:29:03 +03:00
Sergey Krashevich e2e593ea3a feat(schema): add new motion detection options and properties - extend motion detection modes to include 'onvif' for event subscription - introduce 'motion_hold_time' to manage active motion duration - add 'onvif_url' for specifying ONVIF device URL for detection 2026-03-10 22:28:29 +03:00
Sergey Krashevich 8a21809f18 feat(homekit): add ONVIF motion detection support
- implement ONVIF motion watcher to handle motion events
- add configuration options for motion hold time and ONVIF URL
- remap motion mode from "onvif" to "api" for compatibility
- log ONVIF motion watcher activity for better debugging

feat(onvif): implement event subscription for motion detection
- create PullPoint subscription to receive motion events
- implement methods for pulling messages and renewing subscriptions
- handle event requests and responses specific to motion detection

test(onvif): add unit tests for motion event parsing and subscription
- create tests for parsing various motion event XML responses
- verify correct handling of multiple notifications and edge cases
- test resolving event addresses for ONVIF clients

fix(hksv): improve motion detection logging
- log warnings when accessory or character not found during motion detection
- log number of listeners notified during motion state changes

feat(hap): add listener count method
- introduce method to retrieve the number of listeners for a character

feat(onvif): enhance ONVIF client with event URL handling
- extract event URL from ONVIF device response for subscription management
2026-03-09 13:06:57 +03:00
Sergey Krashevich e3d1085a6d feat(hksv): add motion detection API and enhance server handling for consumers 2026-03-07 18:54:50 +03:00
Sergey Krashevich 9c901dc995 feat(hksv): add example CLI application for exporting RTSP cameras as HKSV 2026-03-06 20:54:53 +03:00
Sergey Krashevich c1ff7464d0 Add unit tests for HKSV 2026-03-06 20:48:32 +03:00
Sergey Krashevich c5b7ba7162 feat(hksv): add example CLI application for RTSP to HomeKit Secure Video streaming 2026-03-06 20:39:47 +03:00
Sergey Krashevich c567831c91 feat: add motion detection feature with EMA-based P-frame size analysis
- Implemented MotionDetector for detecting motion based on H.264 P-frame sizes.
- Introduced adjustable sensitivity threshold for motion detection.
- Added tests for various scenarios including motion detection, hold time, cooldown, and baseline adaptation.
- Created hksvSession to manage HDS DataStream connections for HKSV recording.
- Updated schema.json to include a new speaker option for 2-way audio support.
2026-03-06 19:58:15 +03:00
Sergey Krashevich 593dce6eb9 feat(homekit): add Speaker service and enhance Consumer with backtrack audio handling 2026-03-06 09:07:26 +03:00
Sergey Krashevich 78ef8fc064 perf(homekit): optimize motion detector with frame-based timing
Replace time.Now() calls in hot path with frame-based timing:
- Pre-compute triggerLevel (integer comparison instead of float division)
- Calibrate hold/cooldown budgets from FPS (default 30fps)
- Periodic FPS recalibration every 150 frames for accuracy
- Active motion path: 47ns → 3.6ns (13x faster)

Update schema.json with detect mode and motion_threshold.
Add threshold tuning guide to README.
2026-03-05 08:50:27 +03:00
Sergey Krashevich a591186da6 test(homekit): add tests and benchmarks for HDS protocol and HKSV consumer
HDS protocol tests (15 tests, 4 benchmarks):
- Message structure for SendMediaInit and SendMediaFragment
- Multi-chunk splitting for fragments > 256KB
- Chunk boundary handling and sequence preservation
- WriteEvent/WriteResponse/WriteRequest round-trip
- opack helper functions

HKSV consumer tests (14 tests, 3 benchmarks):
- Consumer creation and field initialization
- GOP buffer flush with sequence numbering
- Activate with init segment and seqNum=2
- Activate timeout and error handling
- Stop safety (double-stop, deactivation)
- WriteTo blocking until Stop

Also fixes broken hds_test.go (undefined Client → NewConn).
2026-03-05 06:43:11 +03:00
Sergey Krashevich 1856b7ace4 fix(homekit): fix HKSV recording by correcting HDS protocol and adding GOP buffering
The HKSV recording was failing because:
1. The dataSend.data message structure was wrong - `packets` was a flat integer
   instead of an array of objects with `data` and `metadata` fields matching
   the HAP-NodeJS specification
2. Each video/audio frame was sent as a separate mediaFragment, but Home Hub
   expects GOP-based fragments (~2-4 seconds of accumulated data)
3. Large fragments were not chunked (max 256 KiB per chunk)

Changes:
- Fix HDS dataSend.data message structure to use proper packets array with
  nested data/metadata (dataType, dataSequenceNumber, dataChunkSequenceNumber,
  isLastDataChunk, dataTotalSize)
- Add 256 KiB chunking for large media fragments
- Buffer moof+mdat pairs in hksvConsumer and flush on keyframe boundaries
  (GOP-based fragmentation)
- Pre-start consumer at pair-verify for instant init segment delivery
- Add write-response support to HAP PUT handler for ch131 DataStream setup
- Fix HAP service linking to match HAP-NodeJS reference
- Add default SelectedCameraRecordingConfiguration (ch209) value
- Start continuous motion generator at pair-verify with dedup protection
2026-03-05 06:26:06 +03:00
Sergey Krashevich 35fd1383c8 fix(homekit): adjust motion detection threshold and improve hold time checks 2026-03-05 03:09:02 +03:00
Sergey Krashevich 15b0cc4c0c feat(homekit): implement motion detection with configurable threshold and add motion detector functionality 2026-03-04 15:08:06 +03:00
Sergey Krashevich 81dd9e37d8 chore: update .gitignore to include .claude* and .ruff* files 2026-03-04 14:20:33 +03:00
Sergey Krashevich ab27a042c1 feat(homekit): add HKSV support with motion detection and doorbell functionality
- Introduced HKSV configuration options in homekit.go, allowing for motion detection and doorbell features.
- Implemented API endpoints for triggering motion detection and doorbell events.
- Enhanced server.go to handle HKSV sessions and manage motion detection states.
- Created new accessory types for HKSV and doorbell in accessory.go.
- Added support for audio recording configurations in ch207.go.
- Defined new services for motion detection and doorbell in services_hksv.go.
- Implemented opack encoding/decoding for HDS protocol in opack.go and protocol.go.
- Updated OpenAPI documentation to reflect new endpoints and features.
- Extended schema.json to include HKSV configuration options.
2026-03-04 13:53:17 +03:00
Sergey Krashevich a0a36f87bd feat(tests): add CDN URL extraction and patching tests
- implement tests for extracting CDN URLs from HTML files
- add tests for parsing CDN URLs and patching HTML content
- ensure functionality works with real HTML files and CDN URLs
2026-02-16 05:20:25 +03:00
Sergey Krashevich 73c43dbf8b Add CDN dependency download script and update Dockerfiles for offline web UI 2026-02-16 04:50:24 +03:00