@camera.ui/server 0.0.50-internal.0 → 0.0.50-internal.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/interface/index.html +44 -44
- package/dist/interface/js/{@primevue.OhxoO3MD.0.0.50-internal.0.js → @primevue.CiB2EGly.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{@tanstack.D1IL6eOv.0.0.50-internal.0.js → @tanstack.DxMw_rJn.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{@vee-validate.BGPyWWTh.0.0.50-internal.0.js → @vee-validate.RxZ3hn6V.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{@vueuse.BsKtqdiG.0.0.50-internal.0.js → @vueuse.C-k73ACm.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Adminpanel.D93Kvbwp.0.0.50-internal.0.js → Adminpanel.DumNu6GD.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Camera.DF2l3OMA.0.0.50-internal.0.js → Camera.BuosoqFl.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Cameras.YzvZccdv.0.0.50-internal.0.js → Cameras.A7NJflGG.0.0.50-internal.1.js} +2 -2
- package/dist/interface/js/Cammesh.Dv3C0UiR.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{Camview.CB7_HnoQ.0.0.50-internal.0.js → Camview.GgjJp7JR.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Config.BwflsWTm.0.0.50-internal.0.js → Config.BL3L-BFE.0.0.50-internal.1.js} +2 -2
- package/dist/interface/js/{Console.DZM8pN8Q.0.0.50-internal.0.js → Console.CxwRmUVF.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{CuiConsole.BXXU7Gth.0.0.50-internal.0.js → CuiConsole.D16kkT6R.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{CuiPluginCard.YFOrpbVD.0.0.50-internal.0.js → CuiPluginCard.Bkp__d8n.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{CuiTimeline.VV5KSJd5.0.0.50-internal.0.js → CuiTimeline.C9HKvo0G.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{FirstSteps.b-nvymgb.0.0.50-internal.0.js → FirstSteps.QuJjtAtF.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Plugin.BOMpVEwM.0.0.50-internal.0.js → Plugin.BLUUbEej.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Plugins.DdPwaUDA.0.0.50-internal.0.js → Plugins.DviCIk7w.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/Recordings.Dsp07cHs.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{Settings.D24ttaPu.0.0.50-internal.0.js → Settings.Clx4y9gP.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsAccount.ms3aqz4E.0.0.50-internal.0.js → SettingsAccount.cfY4-PYd.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/SettingsAppearance.CBGZAazb.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{SettingsAppearance.vue_vue_type_script_setup_true_lang.CBQ6lL3T.0.0.50-internal.0.js → SettingsAppearance.vue_vue_type_script_setup_true_lang.kxAPXcBy.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsBackup.BPEc4Rjg.0.0.50-internal.0.js → SettingsBackup.DOaJA4pp.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/SettingsRecordings.BGcwL6tk.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{SettingsRemote.BL5nXbUT.0.0.50-internal.0.js → SettingsRemote.BVU_w1Jm.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsSystem.D7T0AIpm.0.0.50-internal.0.js → SettingsSystem.P0vy90vA.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsUsers.1u0vCOVG.0.0.50-internal.0.js → SettingsUsers.DaP5m7eo.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{VersionsHandler.vue_vue_type_script_setup_true_lang.xDishkkS.0.0.50-internal.0.js → VersionsHandler.vue_vue_type_script_setup_true_lang.MmrWYW3K.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{ace-builds.D1nmvCwb.0.0.50-internal.0.js → ace-builds.C0aqA_3x.0.0.50-internal.1.js} +2 -2
- package/dist/interface/js/{ace.config.G96T2z54.0.0.50-internal.0.js → ace.config.C9wgzklI.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{backup.B_Gzxtp_.0.0.50-internal.0.js → backup.BeH6lJ5t.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{chart.js.CP_nMnnf.0.0.50-internal.0.js → chart.js.BQHSWV_g.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{close-circle.DYLuVIOg.0.0.50-internal.0.js → close-circle.DDKMxauw.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{dnd-core.T9OeW7mu.0.0.50-internal.0.js → dnd-core.dWz9rJqH.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{draggabilly.D3zGcBb3.0.0.50-internal.0.js → draggabilly.D-iZIS1n.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{engine.io-client.kITRnq-g.0.0.50-internal.0.js → engine.io-client.BwxOddB_.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{fast-deep-equal.Bpc9mIsj.0.0.50-internal.0.js → fast-deep-equal.Dz96RC_N.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{highlight.js.BlSXU-Wb.0.0.50-internal.0.js → highlight.js.CmcM8OM6.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{linkify-it.C3N1lWsJ.0.0.50-internal.0.js → linkify-it.BgLcBzlw.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{main.D0YR3Jat.0.0.50-internal.0.js → main.6bOgRV7D.0.0.50-internal.1.js} +3 -3
- package/dist/interface/js/{markdown-it.Dj0dt5s2.0.0.50-internal.0.js → markdown-it.CTgfs-3p.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{nprogress.BwQWDcGj.0.0.50-internal.0.js → nprogress.CMhnq8jS.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{pinia.DRh7plEC.0.0.50-internal.0.js → pinia.CuC5ZfNs.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{primevue.Cl58krXf.0.0.50-internal.0.js → primevue.DmwjJ4xV.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{qrcode.C1sDj6P8.0.0.50-internal.0.js → qrcode.DGZO3j1c.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{react-dnd-touch-backend.BA4WhUJo.0.0.50-internal.0.js → react-dnd-touch-backend.CEGHlD-T.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{refresh-rounded.D_SmhhUf.0.0.50-internal.0.js → refresh-rounded.D0keXzBc.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{rxjs.C-fTBwEO.0.0.50-internal.0.js → rxjs.CiDbFOB0.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{socket.io-client.DKrRxgjP.0.0.50-internal.0.js → socket.io-client.BPcXPAHG.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{socket.io-parser.EXj3YDH2.0.0.50-internal.0.js → socket.io-parser.DSGzrW_l.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{system.CY8rGd-Q.0.0.50-internal.0.js → system.BKlEObmx.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{trash-fill.CMnCN3Oy.0.0.50-internal.0.js → trash-fill.BDFILs86.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{unidragger.D0w6Tqtt.0.0.50-internal.0.js → unidragger.DcxsxHCS.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vee-validate.BeiObIH8.0.0.50-internal.0.js → vee-validate.BGRg3oQ8.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-chartjs.DtdZdiYw.0.0.50-internal.0.js → vue-chartjs.B9yk2de7.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-i18n.BW2bx_6z.0.0.50-internal.0.js → vue-i18n.DXDZITpf.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-inline-svg.BJkQGmKz.0.0.50-internal.0.js → vue-inline-svg.BDYaTfbi.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-router.B2mOXHaC.0.0.50-internal.0.js → vue-router.CFEDA008.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-zoomable.BKDyCJE7.0.0.50-internal.0.js → vue-zoomable.zqTafMgD.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue3-dnd.DRK24CBp.0.0.50-internal.0.js → vue3-dnd.BxM3dbYs.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{zoom-out.DxvzgVEo.0.0.50-internal.0.js → zoom-out.B6SY9IIj.0.0.50-internal.1.js} +1 -1
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +1 -1
- package/package.json +1 -1
- package/.prettierignore +0 -12
- package/.prettierrc.json +0 -12
- package/artillery.yaml +0 -29
- package/bin/cameraui-server.ts +0 -11
- package/dist/interface/js/Cammesh.D-6dAROQ.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/Recordings.DhxjIW7e.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/SettingsAppearance.DsTjKXk1.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/SettingsRecordings.DgW7M0jj.0.0.50-internal.0.js +0 -1
- package/eslint.config.js +0 -103
- package/localdeps.txt +0 -10
- package/mypy.ini +0 -30
- package/requirements.txt +0 -15
- package/ruff.toml +0 -90
- package/src/__init__.py +0 -0
- package/src/_camera_ui_tools/__init__.py +0 -0
- package/src/_camera_ui_tools/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/api/controllers/api.controller.ts +0 -19
- package/src/api/controllers/auth.controller.ts +0 -294
- package/src/api/controllers/backup.controller.ts +0 -72
- package/src/api/controllers/cameras.controller.ts +0 -1029
- package/src/api/controllers/config.controller.ts +0 -102
- package/src/api/controllers/files.controller.ts +0 -35
- package/src/api/controllers/frameWorkers.controller.ts +0 -109
- package/src/api/controllers/plugins.controller.ts +0 -1206
- package/src/api/controllers/system.controller.ts +0 -273
- package/src/api/controllers/users.controller.ts +0 -648
- package/src/api/database/checks.ts +0 -268
- package/src/api/database/constants.ts +0 -8
- package/src/api/database/index.ts +0 -262
- package/src/api/database/migration.ts +0 -62
- package/src/api/database/selfcheck.ts +0 -492
- package/src/api/database/types.ts +0 -104
- package/src/api/go2rtc/api/application.ts +0 -48
- package/src/api/go2rtc/api/config.ts +0 -61
- package/src/api/go2rtc/api/discover.ts +0 -197
- package/src/api/go2rtc/api/index.ts +0 -49
- package/src/api/go2rtc/api/snapshot.ts +0 -44
- package/src/api/go2rtc/api/streams.ts +0 -168
- package/src/api/go2rtc/index.ts +0 -43
- package/src/api/go2rtc/queue.ts +0 -50
- package/src/api/go2rtc/types.ts +0 -174
- package/src/api/index.ts +0 -286
- package/src/api/middlewares/authPermission.middleware.ts +0 -46
- package/src/api/middlewares/authValidation.middleware.ts +0 -160
- package/src/api/middlewares/pagination.middleware.ts +0 -67
- package/src/api/middlewares/socketAuth.middleware.ts +0 -136
- package/src/api/plugins/header.plugin.ts +0 -15
- package/src/api/plugins/logger.plugin.ts +0 -44
- package/src/api/plugins/proxy.plugin.ts +0 -255
- package/src/api/plugins/socket.plugin.ts +0 -28
- package/src/api/plugins/system.plugin.ts +0 -48
- package/src/api/plugins/useragent.plugin.ts +0 -19
- package/src/api/routes/api.routes.ts +0 -10
- package/src/api/routes/auth.routes.ts +0 -56
- package/src/api/routes/backup.routes.ts +0 -28
- package/src/api/routes/cameras.routes.ts +0 -281
- package/src/api/routes/config.routes.ts +0 -66
- package/src/api/routes/files.routes.ts +0 -15
- package/src/api/routes/frameWorkers.routes.ts +0 -39
- package/src/api/routes/index.ts +0 -37
- package/src/api/routes/plugins.routes.ts +0 -420
- package/src/api/routes/system.routes.ts +0 -101
- package/src/api/routes/users.routes.ts +0 -167
- package/src/api/schemas/backup.schema.ts +0 -112
- package/src/api/schemas/cameras.schema.ts +0 -479
- package/src/api/schemas/config.schema.ts +0 -38
- package/src/api/schemas/go2rtc.schema.ts +0 -189
- package/src/api/schemas/plugins.schema.ts +0 -126
- package/src/api/schemas/storage.schema.ts +0 -11
- package/src/api/schemas/system.schema.ts +0 -45
- package/src/api/schemas/users.schema.ts +0 -185
- package/src/api/services/auth.service.ts +0 -210
- package/src/api/services/backup.service.ts +0 -144
- package/src/api/services/cameras.service.ts +0 -671
- package/src/api/services/plugins.service.ts +0 -470
- package/src/api/services/system.service.ts +0 -85
- package/src/api/services/users.service.ts +0 -276
- package/src/api/types/index.ts +0 -675
- package/src/api/utils/cert.ts +0 -254
- package/src/api/utils/constants.ts +0 -17
- package/src/api/utils/fetch.ts +0 -21
- package/src/api/utils/moveFiles.ts +0 -45
- package/src/api/utils/parse.ts +0 -17
- package/src/api/websocket/index.ts +0 -110
- package/src/api/websocket/nsp/logs.ts +0 -240
- package/src/api/websocket/nsp/main.ts +0 -27
- package/src/api/websocket/nsp/metrics.ts +0 -301
- package/src/api/websocket/nsp/notifications.ts +0 -43
- package/src/api/websocket/nsp/plugins.ts +0 -37
- package/src/api/websocket/nsp/server.ts +0 -220
- package/src/api/websocket/nsp/status.ts +0 -77
- package/src/api/websocket/types.ts +0 -55
- package/src/api.ts +0 -163
- package/src/camera/classes.ts +0 -32
- package/src/camera/controller.ts +0 -579
- package/src/camera/device.ts +0 -422
- package/src/camera/frameWorker.ts +0 -403
- package/src/camera/index.ts +0 -679
- package/src/camera/interfaces.ts +0 -95
- package/src/camera/iou.ts +0 -153
- package/src/camera/polygon.ts +0 -226
- package/src/camera/python/__init__.py +0 -0
- package/src/camera/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/classes.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/delegate_controller.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/interfaces.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/iou.cpython-310.pyc +0 -0
- package/src/camera/python/__pycache__/iou.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/iou2.cpython-310.pyc +0 -0
- package/src/camera/python/__pycache__/polygon.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/video_frame.cpython-311.pyc +0 -0
- package/src/camera/python/classes.py +0 -41
- package/src/camera/python/interfaces.py +0 -130
- package/src/camera/python/iou.py +0 -158
- package/src/camera/python/polygon.py +0 -230
- package/src/camera/python/test/__pycache__/polygon.cpython-310.pyc +0 -0
- package/src/camera/python/test/iou_test.py +0 -799
- package/src/camera/python/test/polygon.py +0 -238
- package/src/camera/python/test/polygon_test.py +0 -256
- package/src/camera/python/test/polygon_test2.py +0 -484
- package/src/camera/python/typings.py +0 -50
- package/src/camera/python/video_frame.py +0 -143
- package/src/camera/session.ts +0 -192
- package/src/camera/streaming/fmp4-session.ts +0 -390
- package/src/camera/streaming/peer-connection.ts +0 -273
- package/src/camera/streaming/rtsp-session.ts +0 -331
- package/src/camera/streaming/webrtc-connection.ts +0 -260
- package/src/camera/streaming/werift-session.ts +0 -317
- package/src/camera/test/iou_test.ts +0 -761
- package/src/camera/test/polygon.test.ts +0 -611
- package/src/camera/test/polygon_test.ts +0 -210
- package/src/camera/types.ts +0 -48
- package/src/camera/utils.ts +0 -489
- package/src/camera/videoFrame.ts +0 -123
- package/src/cloud/index.ts +0 -61
- package/src/cloud/remote/cloudflare.ts +0 -18
- package/src/cloud/remote/upnp.ts +0 -18
- package/src/cloud/remote/utils.ts +0 -24
- package/src/cloud/types.ts +0 -16
- package/src/decoder/child.ts +0 -883
- package/src/decoder/imageUtils.ts +0 -275
- package/src/decoder/manager.ts +0 -251
- package/src/decoder/python/__init__.py +0 -0
- package/src/decoder/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/image_utils.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/utils.cpython-311.pyc +0 -0
- package/src/decoder/python/child.py +0 -903
- package/src/decoder/python/image_utils.py +0 -196
- package/src/decoder/python/pool.py +0 -45
- package/src/decoder/python/test/group.py +0 -62
- package/src/decoder/python/test/motion.mp4 +0 -0
- package/src/decoder/python/test/motion2.mp4 +0 -0
- package/src/decoder/python/test/opencl.cl +0 -70
- package/src/decoder/python/test/opencl2.cl +0 -130
- package/src/decoder/python/test/test.py +0 -427
- package/src/decoder/python/test/test1.jpg +0 -0
- package/src/decoder/python/test/test1_resized.jpg +0 -0
- package/src/decoder/python/test/test2.jpg +0 -0
- package/src/decoder/python/test/test2.py +0 -451
- package/src/decoder/python/test/test2_resized.jpg +0 -0
- package/src/decoder/python/test/test3.jpg +0 -0
- package/src/decoder/python/test/utils.py +0 -50
- package/src/decoder/python/typings.py +0 -57
- package/src/decoder/python/utils.py +0 -70
- package/src/decoder/test/child.ts +0 -117
- package/src/decoder/test/ffmpeg.ts +0 -371
- package/src/decoder/test/test.ts +0 -182
- package/src/decoder/types.ts +0 -27
- package/src/decoder/utils.ts +0 -64
- package/src/decoder/wasm/asconfig.json +0 -28
- package/src/decoder/wasm/assembly/console.ts +0 -1
- package/src/decoder/wasm/assembly/index.ts +0 -890
- package/src/decoder/wasm/build/decoder.d.ts +0 -43
- package/src/decoder/wasm/build/decoder.js +0 -108
- package/src/decoder/wasm/build/decoder.wasm +0 -0
- package/src/decoder/wasm/tsconfig.json +0 -5
- package/src/decoder/worker.ts +0 -113
- package/src/go2rtc/index.ts +0 -324
- package/src/go2rtc/types.ts +0 -88
- package/src/main.ts +0 -267
- package/src/manager/coreManager.ts +0 -78
- package/src/manager/deviceManager.ts +0 -132
- package/src/manager/types.ts +0 -17
- package/src/plugins/index.ts +0 -443
- package/src/plugins/plugin.ts +0 -177
- package/src/plugins/runtime/base.ts +0 -282
- package/src/plugins/runtime/index.ts +0 -15
- package/src/plugins/runtime/node/child.ts +0 -193
- package/src/plugins/runtime/node/index.ts +0 -67
- package/src/plugins/runtime/node/plugin.ts +0 -122
- package/src/plugins/runtime/node/pluginApi.ts +0 -27
- package/src/plugins/runtime/node/proxy/cameraDevice.ts +0 -299
- package/src/plugins/runtime/node/proxy/coreManager.ts +0 -128
- package/src/plugins/runtime/node/proxy/deviceManager.ts +0 -187
- package/src/plugins/runtime/node/storage.ts +0 -312
- package/src/plugins/runtime/node/storageController.ts +0 -91
- package/src/plugins/runtime/python/__init__.py +0 -0
- package/src/plugins/runtime/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/camera_storage.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/config_service.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/constants.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/ipc.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/logger.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/message_queue.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/namespaces.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin_api.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin_logger.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/proxy_utils.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/schema.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/storage.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/storage_controller.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/child.py +0 -248
- package/src/plugins/runtime/python/index.ts +0 -73
- package/src/plugins/runtime/python/namespaces.py +0 -101
- package/src/plugins/runtime/python/plugin.py +0 -155
- package/src/plugins/runtime/python/plugin_api.py +0 -29
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/core_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/camera_device.py +0 -1732
- package/src/plugins/runtime/python/proxy/core_manager.py +0 -126
- package/src/plugins/runtime/python/proxy/device_manager.py +0 -197
- package/src/plugins/runtime/python/schema.py +0 -99
- package/src/plugins/runtime/python/storage.py +0 -353
- package/src/plugins/runtime/python/storage_controller.py +0 -102
- package/src/plugins/runtime/python/typings.py +0 -195
- package/src/plugins/schema.ts +0 -472
- package/src/plugins/types.ts +0 -60
- package/src/plugins/worker.ts +0 -250
- package/src/rpc/index.ts +0 -149
- package/src/rpc/namespaces.ts +0 -79
- package/src/rpc/server.ts +0 -422
- package/src/rpc/types.ts +0 -119
- package/src/rpc/utils.ts +0 -16
- package/src/services/config/constants.ts +0 -47
- package/src/services/config/defaults.ts +0 -57
- package/src/services/config/index.ts +0 -744
- package/src/services/config/types.ts +0 -211
- package/src/services/logger/index.ts +0 -96
- package/src/types.ts +0 -47
- package/src/utils/path.ts +0 -16
- package/src/utils/pythonInstaller.ts +0 -597
- package/tsconfig.json +0 -37
- package/updates.config.js +0 -3
- /package/dist/interface/assets/{@xterm.DYP7pi_n.0.0.50-internal.0.css → @xterm.DYP7pi_n.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Adminpanel.BKek2EMH.0.0.50-internal.0.css → Adminpanel.BKek2EMH.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Cameras.BDWZJqPN.0.0.50-internal.0.css → Cameras.BDWZJqPN.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Camview.BFUFMoNX.0.0.50-internal.0.css → Camview.BFUFMoNX.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{CuiConsole.DCYyxdVg.0.0.50-internal.0.css → CuiConsole.DCYyxdVg.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{CuiPluginCard.yF8V0SZY.0.0.50-internal.0.css → CuiPluginCard.yF8V0SZY.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{CuiTimeline.BkIwlYtw.0.0.50-internal.0.css → CuiTimeline.BkIwlYtw.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Plugin.DJElsAn5.0.0.50-internal.0.css → Plugin.DJElsAn5.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Plugins.0h77qnmN.0.0.50-internal.0.css → Plugins.0h77qnmN.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Settings.CkgfRkQr.0.0.50-internal.0.css → Settings.CkgfRkQr.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{SettingsAccount.DeFul3eQ.0.0.50-internal.0.css → SettingsAccount.DeFul3eQ.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{SettingsBackup.CX0rT0QJ.0.0.50-internal.0.css → SettingsBackup.CX0rT0QJ.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{highlight.Ch2EwETz.0.0.50-internal.0.css → highlight.Ch2EwETz.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{logo-256.BCQk9H1-.0.0.50-internal.0.png → logo-256.BCQk9H1-.0.0.50-internal.1.png} +0 -0
- /package/dist/interface/assets/{logo-512.DLKVOU2S.0.0.50-internal.0.png → logo-512.DLKVOU2S.0.0.50-internal.1.png} +0 -0
- /package/dist/interface/assets/{logo.DmEiRk0z.0.0.50-internal.0.png → logo.DmEiRk0z.0.0.50-internal.1.png} +0 -0
- /package/dist/interface/assets/{main.Cip9LkS3.0.0.50-internal.0.css → main.Cip9LkS3.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{mode-json.Br7xisR1.0.0.50-internal.0.js → mode-json.Br7xisR1.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{mode-yaml.CIYL8U3d.0.0.50-internal.0.js → mode-yaml.CIYL8U3d.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{worker-base.jEXLGV2h.0.0.50-internal.0.js → worker-base.jEXLGV2h.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{worker-json.DgwNIOck.0.0.50-internal.0.js → worker-json.DgwNIOck.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{worker-yaml.B3uUYINB.0.0.50-internal.0.js → worker-yaml.B3uUYINB.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@babel.l0sNRNKZ.0.0.50-internal.0.js → @babel.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@intlify.BkGPX90O.0.0.50-internal.0.js → @intlify.BkGPX90O.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@kurkle.D8fDXNIl.0.0.50-internal.0.js → @kurkle.D8fDXNIl.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@primeuix.BFAY2Bk9.0.0.50-internal.0.js → @primeuix.BFAY2Bk9.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@react-dnd.CcwRs9xb.0.0.50-internal.0.js → @react-dnd.CcwRs9xb.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@socket.io.Dkula2eQ.0.0.50-internal.0.js → @socket.io.Dkula2eQ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@vue.B5vqhCp2.0.0.50-internal.0.js → @vue.B5vqhCp2.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@xterm.CAa7rpjv.0.0.50-internal.0.js → @xterm.DIUBesyz.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{axios.DHr9lByg.0.0.50-internal.0.js → axios.DHr9lByg.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{birpc.l0sNRNKZ.0.0.50-internal.0.js → birpc.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{compare-versions.DqEOhma6.0.0.50-internal.0.js → compare-versions.DqEOhma6.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{dijkstrajs.C00ieaqj.0.0.50-internal.0.js → dijkstrajs.C00ieaqj.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{engine.io-parser.BiEtp6m2.0.0.50-internal.0.js → engine.io-parser.BiEtp6m2.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{entities.C20TfXL6.0.0.50-internal.0.js → entities.C20TfXL6.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{ev-emitter.X5f1qa-c.0.0.50-internal.0.js → ev-emitter.X5f1qa-c.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{get-size.D1dS-IaP.0.0.50-internal.0.js → get-size.D1dS-IaP.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{hookable.l0sNRNKZ.0.0.50-internal.0.js → hookable.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{mdurl.k9Sl0PQj.0.0.50-internal.0.js → mdurl.k9Sl0PQj.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{perfect-debounce.l0sNRNKZ.0.0.50-internal.0.js → perfect-debounce.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{primelocale.Bga3dOQu.0.0.50-internal.0.js → primelocale.Bga3dOQu.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{punycode.js.Dj65hjkv.0.0.50-internal.0.js → punycode.js.Dj65hjkv.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.0.js → react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{redux.BFxtlG_c.0.0.50-internal.0.js → redux.BFxtlG_c.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{tslib.9k7AwCpt.0.0.50-internal.0.js → tslib.9k7AwCpt.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{uc.micro.kMc2yuuw.0.0.50-internal.0.js → uc.micro.kMc2yuuw.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{uuid.C6aID195.0.0.50-internal.0.js → uuid.C6aID195.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{vue.l0sNRNKZ.0.0.50-internal.0.js → vue.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{zod.SKKegNRO.0.0.50-internal.0.js → zod.SKKegNRO.0.0.50-internal.1.js} +0 -0
package/src/camera/session.ts
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { sleep, Subscribed } from '@camera.ui/common/utils';
|
|
2
|
-
import { RTSPClient } from '@camera.ui/rtsp/rtspClient';
|
|
3
|
-
import { ReplaySubject } from 'rxjs';
|
|
4
|
-
|
|
5
|
-
import type { CameraDeviceSource } from '@camera.ui/types';
|
|
6
|
-
import type { CameraController } from './controller.js';
|
|
7
|
-
|
|
8
|
-
export class Session {
|
|
9
|
-
readonly onStarted = new ReplaySubject<void>();
|
|
10
|
-
readonly onError = new ReplaySubject<Error>();
|
|
11
|
-
readonly onConnected = new ReplaySubject<void>();
|
|
12
|
-
readonly onCallEnded = new ReplaySubject<void>(1);
|
|
13
|
-
|
|
14
|
-
private client: RTSPClient;
|
|
15
|
-
private isStopped = false;
|
|
16
|
-
private hasEnded = false;
|
|
17
|
-
|
|
18
|
-
constructor(
|
|
19
|
-
private camera: CameraController,
|
|
20
|
-
private source: CameraDeviceSource,
|
|
21
|
-
) {
|
|
22
|
-
this.client = new RTSPClient({ url: this.source.urls.rtsp.muted, readOnly: true });
|
|
23
|
-
this.bindConnection();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public async start() {
|
|
27
|
-
if (!this.camera.connected || this.isStopped) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
this.hasEnded = false;
|
|
32
|
-
await this.client.start();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public async stop() {
|
|
36
|
-
this.isStopped = true;
|
|
37
|
-
await this.callEnded();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
private bindConnection(): void {
|
|
41
|
-
this.client.onPlay.subscribe(this.onConnected);
|
|
42
|
-
this.client.onClose.subscribe((error) => {
|
|
43
|
-
if (error) {
|
|
44
|
-
this.callError(error);
|
|
45
|
-
} else {
|
|
46
|
-
this.callEnded();
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
private async callError(error: Error): Promise<void> {
|
|
52
|
-
this.onError.next(error);
|
|
53
|
-
await this.callEnded();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
private async callEnded(): Promise<void> {
|
|
57
|
-
if (this.hasEnded) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
this.hasEnded = true;
|
|
62
|
-
|
|
63
|
-
await this.client.close();
|
|
64
|
-
this.onCallEnded.next();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export class SessionController extends Subscribed {
|
|
69
|
-
private readonly sessions = new Map<string, Session>();
|
|
70
|
-
private killed = false;
|
|
71
|
-
private restartTimer = 60000;
|
|
72
|
-
|
|
73
|
-
constructor(private camera: CameraController) {
|
|
74
|
-
super();
|
|
75
|
-
|
|
76
|
-
this.setupEventListeners();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public start(sources: CameraDeviceSource[]): void {
|
|
80
|
-
if (!this.camera.connected) {
|
|
81
|
-
this.camera.logger.debug('Camera not connected, hot mode will not start');
|
|
82
|
-
this.stop();
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
this.removeOrphanedSessions(sources);
|
|
87
|
-
this.createNewSessions(sources);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public stop(): void {
|
|
91
|
-
this.killed = true;
|
|
92
|
-
this.unsubscribe();
|
|
93
|
-
this.stopSessions();
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
private setupEventListeners(): void {
|
|
97
|
-
this.addSubscriptions(
|
|
98
|
-
this.camera.onPropertyChange('sources').subscribe(() => {
|
|
99
|
-
if (this.killed) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
this.start(this.camera.sources);
|
|
103
|
-
}),
|
|
104
|
-
|
|
105
|
-
this.camera.onConnected.subscribe((connected) => {
|
|
106
|
-
if (connected) {
|
|
107
|
-
this.start(this.camera.sources);
|
|
108
|
-
} else {
|
|
109
|
-
this.stopSessions();
|
|
110
|
-
}
|
|
111
|
-
}),
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
private async startSession(source: CameraDeviceSource, session: Session): Promise<void> {
|
|
116
|
-
if (!this.canStartSession(source)) {
|
|
117
|
-
this.camera.logger.debug(`[${source.name}] Skipping hot mode start`);
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
try {
|
|
122
|
-
this.camera.logger.debug(`[${source.name}] Starting hot mode...`);
|
|
123
|
-
await session.start();
|
|
124
|
-
} catch (error) {
|
|
125
|
-
this.camera.logger.debug(`[${source.name}] Failed to start hot mode:`, error.message);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
private setupEventListener(source: CameraDeviceSource, session: Session): void {
|
|
130
|
-
this.addSubscriptions(
|
|
131
|
-
session.onConnected.subscribe(() => {
|
|
132
|
-
this.camera.logger.debug(`[${source.name}] Hot mode started`);
|
|
133
|
-
}),
|
|
134
|
-
session.onError.subscribe((error) => {
|
|
135
|
-
this.camera.logger.debug(`[${source.name}] Hot mode error:`, error.message);
|
|
136
|
-
}),
|
|
137
|
-
session.onCallEnded.subscribe(async () => {
|
|
138
|
-
this.camera.logger.debug(`[${source.name}] Hot mode stopped`);
|
|
139
|
-
|
|
140
|
-
if (!this.canStartSession(source)) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
try {
|
|
145
|
-
await sleep(this.restartTimer);
|
|
146
|
-
await this.startSession(source, session);
|
|
147
|
-
} catch (error) {
|
|
148
|
-
this.camera.logger.debug(`[${source.name}] Failed to restart hot mode:`, error.message);
|
|
149
|
-
}
|
|
150
|
-
}),
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
private async removeOrphanedSessions(sources: CameraDeviceSource[]): Promise<void> {
|
|
155
|
-
for (const [id, session] of this.sessions.entries()) {
|
|
156
|
-
const source = sources.find((source) => source._id === id);
|
|
157
|
-
if (source && !this.canStartSession(source)) {
|
|
158
|
-
await session.stop();
|
|
159
|
-
this.sessions.delete(id);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
private createNewSessions(sources: CameraDeviceSource[]): void {
|
|
165
|
-
for (const source of sources) {
|
|
166
|
-
if (source.role !== 'snapshot' && source.hotMode && !this.sessions.has(source._id)) {
|
|
167
|
-
const session = new Session(this.camera, source);
|
|
168
|
-
this.sessions.set(source._id, session);
|
|
169
|
-
this.setupEventListener(source, session);
|
|
170
|
-
this.startSession(source, session);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
private stopSessions(): void {
|
|
176
|
-
for (const session of this.sessions.values()) {
|
|
177
|
-
session.stop();
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
private canStartSession(source: CameraDeviceSource): boolean {
|
|
182
|
-
const cameraSource = this.camera.sources.find((s) => s._id === source._id);
|
|
183
|
-
return (
|
|
184
|
-
!this.killed &&
|
|
185
|
-
this.camera.connected &&
|
|
186
|
-
cameraSource !== undefined &&
|
|
187
|
-
cameraSource.hotMode &&
|
|
188
|
-
cameraSource.role !== 'snapshot' &&
|
|
189
|
-
this.sessions.has(cameraSource._id)
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
import { FfmpegProcess, generateAudioStreamInfo, generateSdp, generateVideoStreamInfo, parseMp4Fragment, reservePorts, RtpSplitter } from '@camera.ui/common/camera';
|
|
2
|
-
import { getCleanSdp, SubscribedPublic } from '@camera.ui/common/utils';
|
|
3
|
-
import { RTSPClient } from '@camera.ui/rtsp/rtspClient';
|
|
4
|
-
import { firstValueFrom, ReplaySubject, Subject } from 'rxjs';
|
|
5
|
-
import { take, tap } from 'rxjs/operators';
|
|
6
|
-
import { WebSocket } from 'ws';
|
|
7
|
-
|
|
8
|
-
import type {
|
|
9
|
-
AudioStreamInfo,
|
|
10
|
-
CameraDeviceSource,
|
|
11
|
-
CameraInput,
|
|
12
|
-
FMP4ConnectionOptions,
|
|
13
|
-
FMP4Session as FMP4SessionInterface,
|
|
14
|
-
Fragment,
|
|
15
|
-
FragmentedFfmpegOptions,
|
|
16
|
-
LoggerService,
|
|
17
|
-
VideoStreamInfo,
|
|
18
|
-
} from '@camera.ui/types';
|
|
19
|
-
import type { CameraDevice } from '../device.js';
|
|
20
|
-
|
|
21
|
-
export class FMP4Session extends SubscribedPublic implements FMP4SessionInterface {
|
|
22
|
-
readonly onStarted = new ReplaySubject<void>();
|
|
23
|
-
readonly onError = new ReplaySubject<Error>();
|
|
24
|
-
readonly onCallEnded = new ReplaySubject<void>(1);
|
|
25
|
-
readonly onFragment = new Subject<Fragment>();
|
|
26
|
-
|
|
27
|
-
readonly #audioSplitter = new RtpSplitter();
|
|
28
|
-
readonly #videoSplitter = new RtpSplitter();
|
|
29
|
-
|
|
30
|
-
#hasEnded = false;
|
|
31
|
-
#cameraDevice: CameraDevice;
|
|
32
|
-
#logger: LoggerService;
|
|
33
|
-
#source: CameraDeviceSource;
|
|
34
|
-
|
|
35
|
-
#client: RTSPClient;
|
|
36
|
-
#ws: WebSocket | null = null;
|
|
37
|
-
|
|
38
|
-
#ftypSegment?: Buffer;
|
|
39
|
-
#moovSegment?: Buffer;
|
|
40
|
-
#initSegment?: Buffer;
|
|
41
|
-
|
|
42
|
-
#logPrefix = '[fMP4]';
|
|
43
|
-
|
|
44
|
-
#initSegmentSubject = new ReplaySubject<Buffer>(1);
|
|
45
|
-
|
|
46
|
-
get initSegment(): Promise<Buffer> {
|
|
47
|
-
return firstValueFrom(this.#initSegmentSubject);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
constructor(cameraDevice: CameraDevice, source: CameraInput, options?: FMP4ConnectionOptions) {
|
|
51
|
-
super();
|
|
52
|
-
|
|
53
|
-
this.#cameraDevice = cameraDevice;
|
|
54
|
-
this.#logger = cameraDevice.logger;
|
|
55
|
-
this.#source = this.#cameraDevice.sources.find((s) => s.name === source.name)!;
|
|
56
|
-
|
|
57
|
-
const url = options?.url ?? this.#source.generateRTSPUrl();
|
|
58
|
-
|
|
59
|
-
this.#client = new RTSPClient(
|
|
60
|
-
{ url },
|
|
61
|
-
{
|
|
62
|
-
// log: (...args) => this.#logger.log(...args),
|
|
63
|
-
error: (...args) => this.#logger.error(...args),
|
|
64
|
-
// debug: (...args) => this.#logger.trace(...args),
|
|
65
|
-
warn: (...args) => this.#logger.warn(...args),
|
|
66
|
-
},
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
public startStream(): void {
|
|
71
|
-
if (this.#hasEnded) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const wsUrl = new URL(this.#source.urls.ws.mse);
|
|
76
|
-
this.#ws = new WebSocket(wsUrl.toString(), {
|
|
77
|
-
rejectUnauthorized: false,
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
this.#ws.binaryType = 'arraybuffer';
|
|
81
|
-
|
|
82
|
-
this.#ws.onopen = () => {
|
|
83
|
-
this.#ws?.send(
|
|
84
|
-
JSON.stringify({
|
|
85
|
-
type: 'mse',
|
|
86
|
-
value: {
|
|
87
|
-
value: 'avc1.640029,avc1.64002A,avc1.640033,hvc1.1.6.L153.B0,mp4a.40.2,mp4a.40.5,flac,opus',
|
|
88
|
-
fragmentMode: 'keyframe',
|
|
89
|
-
},
|
|
90
|
-
}),
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
this.#ws.onmessage = (event) => {
|
|
95
|
-
if (typeof event.data === 'string') {
|
|
96
|
-
const message = JSON.parse(event.data);
|
|
97
|
-
if (message.type === 'mse') {
|
|
98
|
-
this.#logger.debug(this.#logPrefix, 'Received codec info:', message.value);
|
|
99
|
-
this.onStarted.next();
|
|
100
|
-
} else if (message.type === 'error') {
|
|
101
|
-
this.#callError(new Error(message.value));
|
|
102
|
-
}
|
|
103
|
-
} else {
|
|
104
|
-
if (event.data instanceof ArrayBuffer) {
|
|
105
|
-
this.#handleFragment(Buffer.from(event.data));
|
|
106
|
-
} else if (Buffer.isBuffer(event.data)) {
|
|
107
|
-
this.#handleFragment(event.data);
|
|
108
|
-
} else {
|
|
109
|
-
event.data.forEach((fragment) => this.#handleFragment(fragment));
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
this.#ws.onerror = (error) => {
|
|
115
|
-
this.#callError(error.error);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
this.#ws.onclose = () => {
|
|
119
|
-
this.#callEnded();
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
public async startTranscoding(ffmpegOptions: FragmentedFfmpegOptions): Promise<void> {
|
|
124
|
-
if (this.#hasEnded) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const transcodeAudioStream = ffmpegOptions.audio !== undefined && ffmpegOptions.audio.length > 0;
|
|
129
|
-
const transcodeVideoStream = ffmpegOptions.video !== undefined && ffmpegOptions.video.length > 0;
|
|
130
|
-
|
|
131
|
-
const loggerPrefix = ffmpegOptions?.logPrefix ? `[${ffmpegOptions.logPrefix}] ` : `[${this.#logPrefix}] `;
|
|
132
|
-
|
|
133
|
-
try {
|
|
134
|
-
if (!transcodeAudioStream && !transcodeVideoStream) {
|
|
135
|
-
throw new Error('No transcoding options provided! Can not start transcoding!');
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
await this.#client.start();
|
|
139
|
-
|
|
140
|
-
const audioTrack = this.#client.getAudioTrack();
|
|
141
|
-
const videoTrack = this.#client.getVideoTrack();
|
|
142
|
-
|
|
143
|
-
if (!audioTrack && !videoTrack) {
|
|
144
|
-
throw new Error('No audio or video tracks found! Can not start transcoding!');
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
await this.#audioSplitter.prepare('udp4');
|
|
148
|
-
await this.#videoSplitter.prepare('udp4');
|
|
149
|
-
|
|
150
|
-
if (!this.#audioSplitter.port || !this.#videoSplitter.port) {
|
|
151
|
-
throw new Error('No ports available for audio and video splitter! Can not start transcoding!');
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const videoPort = await this.#reservePort(1);
|
|
155
|
-
const audioPort = await this.#reservePort(1);
|
|
156
|
-
|
|
157
|
-
const videoStreamInfos = videoTrack ? generateVideoStreamInfo([videoTrack.mediaSource]) : [];
|
|
158
|
-
const audioStreamInfos = audioTrack ? generateAudioStreamInfo([audioTrack.mediaSource]) : [];
|
|
159
|
-
const parsedSdp = generateSdp(videoStreamInfos, audioStreamInfos);
|
|
160
|
-
|
|
161
|
-
const audioStream: AudioStreamInfo | undefined = audioStreamInfos[0];
|
|
162
|
-
const videoStream: VideoStreamInfo | undefined = videoStreamInfos[0];
|
|
163
|
-
|
|
164
|
-
const audioInputArgs = audioStream ? ['-acodec', audioStream.ffmpegCodec] : [];
|
|
165
|
-
const videoInputArgs = videoStream ? ['-vcodec', videoStream.ffmpegCodec] : [];
|
|
166
|
-
|
|
167
|
-
const audioOutputArgs = audioTrack && transcodeAudioStream ? (ffmpegOptions.audio ?? ['-acodec', audioStream.ffmpegCodec]) : [];
|
|
168
|
-
const videoOutputArgs = videoTrack && transcodeVideoStream ? (ffmpegOptions.video ?? ['-vcodec', videoStream.ffmpegCodec]) : [];
|
|
169
|
-
|
|
170
|
-
const inputArgs = ffmpegOptions.input ?? [];
|
|
171
|
-
|
|
172
|
-
const inputSdp = getCleanSdp(parsedSdp, transcodeVideoStream, 'recvonly')
|
|
173
|
-
.replace(/m=audio \d+/, `m=audio ${audioPort}`)
|
|
174
|
-
.replace(/m=video \d+/, `m=video ${videoPort}`);
|
|
175
|
-
|
|
176
|
-
this.#logger.trace(loggerPrefix + 'Start transcoding with SDP:\n', inputSdp);
|
|
177
|
-
|
|
178
|
-
const ff = new FfmpegProcess({
|
|
179
|
-
ffmpegArgs: [
|
|
180
|
-
'-hide_banner',
|
|
181
|
-
'-protocol_whitelist',
|
|
182
|
-
'pipe,udp,rtp,file,crypto',
|
|
183
|
-
'-reorder_queue_size',
|
|
184
|
-
'0',
|
|
185
|
-
...audioInputArgs,
|
|
186
|
-
...videoInputArgs,
|
|
187
|
-
'-f',
|
|
188
|
-
'sdp',
|
|
189
|
-
...inputArgs,
|
|
190
|
-
'-i',
|
|
191
|
-
'pipe:',
|
|
192
|
-
...audioOutputArgs,
|
|
193
|
-
...videoOutputArgs,
|
|
194
|
-
'-fflags',
|
|
195
|
-
'+genpts',
|
|
196
|
-
'-reset_timestamps',
|
|
197
|
-
'1',
|
|
198
|
-
'-movflags',
|
|
199
|
-
'frag_keyframe+empty_moov+default_base_moof',
|
|
200
|
-
'-f',
|
|
201
|
-
'mp4',
|
|
202
|
-
'-',
|
|
203
|
-
],
|
|
204
|
-
ffmpegPath: ffmpegOptions.ffmpegPath,
|
|
205
|
-
startedCallback: () => {
|
|
206
|
-
this.onStarted.next();
|
|
207
|
-
},
|
|
208
|
-
bufferOptions: {
|
|
209
|
-
checkSize: (buffer: Buffer): number => {
|
|
210
|
-
if (buffer.length < 8) return 0;
|
|
211
|
-
|
|
212
|
-
const size = buffer.readUInt32BE(0);
|
|
213
|
-
if (size === 0 || size > buffer.length) return 0;
|
|
214
|
-
|
|
215
|
-
const boxType = buffer.toString('utf8', 4, 8);
|
|
216
|
-
if (boxType === 'moof') {
|
|
217
|
-
if (buffer.length < size + 8) return 0;
|
|
218
|
-
|
|
219
|
-
const nextSize = buffer.readUInt32BE(size);
|
|
220
|
-
const nextBoxType = buffer.toString('utf8', size + 4, size + 8);
|
|
221
|
-
|
|
222
|
-
if (nextBoxType === 'mdat') {
|
|
223
|
-
const totalSize = size + nextSize;
|
|
224
|
-
return buffer.length >= totalSize ? totalSize : 0;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return size;
|
|
229
|
-
},
|
|
230
|
-
onData: (data: Buffer) => {
|
|
231
|
-
this.#handleFragment(data, true);
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
exitCallback: (code, signal) => {
|
|
235
|
-
if (code !== 0 && code !== 255) {
|
|
236
|
-
this.#callError(new Error(`FFmpeg exited with code ${code} and signal ${signal}`));
|
|
237
|
-
} else {
|
|
238
|
-
this.#callEnded();
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
logLabel: loggerPrefix,
|
|
242
|
-
logger: {
|
|
243
|
-
error: (...args) => this.#logger.error(...args),
|
|
244
|
-
trace: () => {},
|
|
245
|
-
// trace: (...args) => this.#logger.trace(...args),
|
|
246
|
-
},
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
if (transcodeAudioStream) {
|
|
250
|
-
this.addSubscriptions(
|
|
251
|
-
this.#client.onAudioRtp
|
|
252
|
-
.pipe(
|
|
253
|
-
tap((rtp) => {
|
|
254
|
-
return this.#audioSplitter.send(rtp.serialize(), {
|
|
255
|
-
port: audioPort,
|
|
256
|
-
address: '127.0.0.1',
|
|
257
|
-
});
|
|
258
|
-
}),
|
|
259
|
-
)
|
|
260
|
-
.subscribe(),
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
if (transcodeVideoStream) {
|
|
265
|
-
this.addSubscriptions(
|
|
266
|
-
this.#client.onVideoRtp
|
|
267
|
-
.pipe(
|
|
268
|
-
tap((rtp) => {
|
|
269
|
-
return this.#videoSplitter.send(rtp.serialize(), {
|
|
270
|
-
port: videoPort,
|
|
271
|
-
address: '127.0.0.1',
|
|
272
|
-
});
|
|
273
|
-
}),
|
|
274
|
-
)
|
|
275
|
-
.subscribe(),
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
this.onCallEnded.pipe(take(1)).subscribe(() => ff.stop());
|
|
280
|
-
|
|
281
|
-
ff.writeStdin(inputSdp);
|
|
282
|
-
} catch (error: any) {
|
|
283
|
-
this.stop();
|
|
284
|
-
throw error;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
public stop(): void {
|
|
289
|
-
this.#callEnded();
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
public async *fragments(abortSignal?: AbortSignal): AsyncGenerator<Fragment> {
|
|
293
|
-
let ended = false;
|
|
294
|
-
|
|
295
|
-
const fragmentPromise = () =>
|
|
296
|
-
new Promise<Fragment>((resolve, reject) => {
|
|
297
|
-
const subscription = this.onFragment.subscribe((fragment) => {
|
|
298
|
-
subscription.unsubscribe();
|
|
299
|
-
resolve(fragment);
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
// Cleanup subscription if session ends
|
|
303
|
-
this.onCallEnded.pipe(take(1)).subscribe(() => {
|
|
304
|
-
subscription.unsubscribe();
|
|
305
|
-
ended = true;
|
|
306
|
-
reject(new Error('Session ended'));
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
if (abortSignal) {
|
|
310
|
-
abortSignal.onabort = () => {
|
|
311
|
-
subscription.unsubscribe();
|
|
312
|
-
ended = true;
|
|
313
|
-
reject(new Error('Aborted'));
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
if (abortSignal.aborted) {
|
|
317
|
-
subscription.unsubscribe();
|
|
318
|
-
ended = true;
|
|
319
|
-
reject(new Error('Aborted'));
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
while (!this.#hasEnded && !abortSignal?.aborted && !ended) {
|
|
325
|
-
try {
|
|
326
|
-
yield await fragmentPromise();
|
|
327
|
-
} catch {
|
|
328
|
-
break;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
async #reservePort(bufferPorts = 0): Promise<number> {
|
|
334
|
-
const ports = await reservePorts({ count: bufferPorts + 1 });
|
|
335
|
-
return ports[0];
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
#handleFragment(data: Buffer, isFFmpeg?: boolean): void {
|
|
339
|
-
const info = parseMp4Fragment(data, isFFmpeg);
|
|
340
|
-
|
|
341
|
-
// this.#logger.trace(this.#logPrefix, 'Received fragment:', info);
|
|
342
|
-
|
|
343
|
-
this.onFragment.next({ data, info });
|
|
344
|
-
|
|
345
|
-
let isInitSegment: Buffer | undefined = undefined;
|
|
346
|
-
|
|
347
|
-
if (info.isFtyp && info.isMoov) {
|
|
348
|
-
isInitSegment = data;
|
|
349
|
-
} else if (info.isFtyp) {
|
|
350
|
-
this.#ftypSegment = data;
|
|
351
|
-
} else if (info.isMoov) {
|
|
352
|
-
this.#moovSegment = data;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (isInitSegment) {
|
|
356
|
-
this.#initSegment = isInitSegment;
|
|
357
|
-
this.#initSegmentSubject.next(isInitSegment);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
if (!this.#initSegment && this.#ftypSegment && this.#moovSegment) {
|
|
361
|
-
this.#initSegment = Buffer.concat([this.#ftypSegment, this.#moovSegment]);
|
|
362
|
-
this.#initSegmentSubject.next(this.#initSegment);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
#callError(error: Error): void {
|
|
367
|
-
this.onError.next(error);
|
|
368
|
-
this.#callEnded();
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
#callEnded(): void {
|
|
372
|
-
if (this.#hasEnded) {
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
this.#initSegment = undefined;
|
|
377
|
-
this.#initSegmentSubject = new ReplaySubject<Buffer>(1);
|
|
378
|
-
this.#ftypSegment = undefined;
|
|
379
|
-
this.#moovSegment = undefined;
|
|
380
|
-
|
|
381
|
-
this.#hasEnded = true;
|
|
382
|
-
|
|
383
|
-
this.unsubscribe();
|
|
384
|
-
|
|
385
|
-
this.#ws?.close();
|
|
386
|
-
this.#ws = null;
|
|
387
|
-
|
|
388
|
-
this.onCallEnded.next();
|
|
389
|
-
}
|
|
390
|
-
}
|