public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
From: Jonathan Hemingway <ehmry@posteo•net>
To: nncp-devel@lists.cypherpunks.ru
Subject: Streaming data of unknown length
Date: Tue, 08 Nov 2022 23:03:34 +0000	[thread overview]
Message-ID: <1667947441.fzsriaxegx.astroid@zuni.home.arpa> (raw)

Hello,

I have an interesting use-case for NNCP and I'm wondering how best to go about it.

Imagine I have a security camera with a fallback battery power supply. Normally the
camera stream is recorded to local storage and discarded after some arbitrary period.

In the event that main power is cut or some other emergency conditions are met the
video stream should immediately feed to some remote storage as well. The remote
storage channel would be NNCP so that the video stream can be transmitted to a
dependable relay and decrypted later.

This situation is different from how NNCP normally works because it must be assumed
that the sender may be taken permantly offline at any momement during transmission.
In this case, what is the best way to use NNCP? A file-transfer with chunking?

Here is an example script to show what I mean:
---------------------------------------------
#!/bin/sh
NODE="${1}"
FILE="$(mktemp --dry-run XXXX.ismv)"

# encode from webcam into nncp-file
ffmpeg -nostats \
                -f alsa -i default -f v4l2 -i /dev/video0 \
                -b:a 48K -b:v 128K \
                -timestamp now \
                -f ismv pipe: \
        | nncp-file -chunked 128 -quiet -nice F - "${NODE}:${FILE}" \
        &

while true; do
        sleep 2s
        nncp-call -onlinedeadline 60 -tx "${NODE}"
done
---------------------------------------------

I'm using chunking here because I think it is the easiest way to reconcstruct
an interrupted stream, but I'm not sure if that is how it works.


Cheers,
Emery

             reply	other threads:[~2022-11-08 23:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08 23:03 Jonathan Hemingway [this message]
2022-11-09 19:23 ` Streaming data of unknown length Sergey Matveev