Show HN: A tool to capture video on one device, encode/store it on another one

mbitsnbites1 pts0 comments

mbitsnbites/videorelay: A lightweight client-server tool for transporting a V4L video stream from one computer to another. - Codeberg.org

This website requires JavaScript.

mbitsnbites/videorelay

Watch

Star

Fork

Code

Issues

Pull requests

Activity

A lightweight client-server tool for transporting a V4L video stream from one computer to another.

ffmpeg

recording

v4l

79 commits

1 branch

0 tags

250 KiB

97.7%

Meson

2.3%

master

Find a file

HTTPS

Download ZIP<br>Download TAR.GZ<br>Download BUNDLE

Open with VS Code

Open with VSCodium

Open with Intellij IDEA

Repository files (latest commit first)

Filename<br>Latest commit message<br>Latest commit date

3ede38c158

README: Document usage

2026-07-17 10:43:39 +02:00

client

client: Fix failures for non-mp4 container formats (e.g. mkv)

2026-07-17 00:44:30 +02:00

common

Estimate the framerate on the server side

2026-07-11 12:59:07 +02:00

doc

README: Add a use case sketch

2026-07-17 10:19:38 +02:00

server

vr_fps_accumulator: Use a more intelligent sliding window

2026-07-12 13:16:00 +02:00

third_party

meson: Add xxhash_dep

2026-07-09 09:00:29 +02:00

.clang-format

Initial commit

2026-07-06 07:16:30 +02:00

.clang-format-ignore

meson: Add xxhash_dep

2026-07-09 09:00:29 +02:00

.clang-tidy

clang-tidy: Update header-filter regex (include common)

2026-07-09 07:41:12 +02:00

.gitignore

gitignore: Add .cache/ (clangd)

2026-07-06 21:25:52 +02:00

AGENTS.md

Add an AGENTS.md

2026-07-06 21:41:45 +02:00

LICENCE

Initial commit

2026-07-06 07:16:30 +02:00

meson.build

meson: Add xxhash_dep

2026-07-09 09:00:29 +02:00

README.md

README: Document usage

2026-07-17 10:43:39 +02:00

README.md

videorelay

A client-server tool for transporting a V4L video stream from one computer to another.

The main use case is to encode and store the video on another device than the one where you do the<br>capturing (e.g. from a web cam or an HDMI grabber). For instance if the capture device does not<br>have enough compute power or storage.

Video and audio are captured from V4L and ALSA by vr-server , and sent over a TCP socket link to<br>vr-client , which then encodes the stream using FFMPEG libraries - typically to an H.264 / AAC<br>mp4 file.

The tool is written in C and is very lightweight and has very little overhead.

Building

Dependencies (Ununtu):

sudo apt install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libasound2-dev libncurses-dev<br>Building:

meson setup --buildtype=release build<br>ninja -C build<br>The tools are:

build/server/vr-server

build/client/vr-client

Usage

First start the server on the device that shall capture the video stream (and optionally an audio<br>stream too). For example:

vr-server -d /dev/video0 -a hw:1,0<br>Once the server is running, start the client on another device (or the same device). For example:

vr-client 192.168.1.12 -o video.mp4 -t 0:30:00<br>Where 192.168.1.12 is the IP address of the device running vr-server, and 0:30:00 tells the<br>client to record for 30 minutes (press CTRL+C to end the recording manually).

Use the -h argument for information about more arguments (both vr-server and vr-client).

Finding capture devices

To list the video input devices, resolutions and video formats:

ls /dev/video* # Show available vide devices<br>v4l2-ctl --list-formats-ext # Show details about each video device<br>E.g. device [0] is /dev/video0, and then pick a suitable format and resolution. For instance<br>-d /dev/video0 -f MJPEG -r 1280x720 could be valid vr-server arguments for a web cam.

To list the audio input devices:

arecord -l<br>E.g. card 1 device 2 can be referred to as -a hw:1,2 when invoking vr-server.

server video client device another stream

Related Articles