You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Built a local dashboard on blinkpy — USB/cloud dedup, WebRTC/MSE live view, and a livestream fix (relates to #1232)
#1301
Wanted to share blink2video, a local web app (Win/Linux/macOS) built on blinkpy for people who want to get off the Blink app: live view, arm/disarm, and local archival that merges two independent sources without ever fetching the same clip twice, the sync module's USB stick and the cloud, matched by camera and timestamp.
Two things from building it that might be useful to other blinkpy users here:
Livestream dropping after a few seconds with no error: BlinkLiveStream.recv uses StreamReader.read(n), which returns as soon as any data is available, not necessarily the n bytes requested. A video packet split across TCP segments (common on larger packets) then reads in pieces, and the code above treats the first partial chunk as a dead connection. Switching to readexactly fixed it for me, confirmed with a regression test reproducing the exact symptom. I see this is already proposed upstream in livestream: read frames with readexactly to avoid truncation #1232, flagging it here too since it silently truncates any long-running live view.
For live view I ended up adding a WebRTC passthrough alongside the existing MSE path: MSE has to wait for an SPS to write the MP4 header before it can emit anything, WebRTC negotiates codec params separately (SDP) and can start from the first keyframe, 2.3 to 2.9x faster to first frame in testing, no reencoding cost. Hit a couple of non-obvious issues along the way (PyAV not exposing SPS/PPS reliably in the packet stream, aiortc only advertising H.264 Baseline while Blink cameras encode High) if anyone has run into similar things.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Wanted to share blink2video, a local web app (Win/Linux/macOS) built on blinkpy for people who want to get off the Blink app: live view, arm/disarm, and local archival that merges two independent sources without ever fetching the same clip twice, the sync module's USB stick and the cloud, matched by camera and timestamp.
Two things from building it that might be useful to other blinkpy users here:
Livestream dropping after a few seconds with no error:
BlinkLiveStream.recvusesStreamReader.read(n), which returns as soon as any data is available, not necessarily the n bytes requested. A video packet split across TCP segments (common on larger packets) then reads in pieces, and the code above treats the first partial chunk as a dead connection. Switching toreadexactlyfixed it for me, confirmed with a regression test reproducing the exact symptom. I see this is already proposed upstream in livestream: read frames with readexactly to avoid truncation #1232, flagging it here too since it silently truncates any long-running live view.For live view I ended up adding a WebRTC passthrough alongside the existing MSE path: MSE has to wait for an SPS to write the MP4 header before it can emit anything, WebRTC negotiates codec params separately (SDP) and can start from the first keyframe, 2.3 to 2.9x faster to first frame in testing, no reencoding cost. Hit a couple of non-obvious issues along the way (PyAV not exposing SPS/PPS reliably in the packet stream, aiortc only advertising H.264 Baseline while Blink cameras encode High) if anyone has run into similar things.
Code's here if useful: https://github.com/nico579/blink2video
Happy to answer questions on any of this.
All reactions