public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
* Streaming data of unknown length
@ 2022-11-08 23:03 Jonathan Hemingway
  2022-11-09 19:23 ` Sergey Matveev
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Hemingway @ 2022-11-08 23:03 UTC (permalink / raw)
  To: nncp-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-09 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 23:03 Streaming data of unknown length Jonathan Hemingway
2022-11-09 19:23 ` Sergey Matveev