Guide · Recording
Recording 4K SDI and HDMI video to MP4 with hardware encoding
Record any input of an LT-300 series card to MP4 in H.264 or HEVC, accelerated by NVIDIA NVENC, Intel Quick Sync or AMD AMF — with bitrate or quality control, automatic file splitting and several inputs at once.
1How recording works
Every recording is done by a file worker: a job created by the agent that reads an input, encodes it and writes files to disk. You can start one in two ways:
- From the command line with
ecurl rec, which records until you pressCtrl+C. - From your application by sending a POST request to the input's
/fileendpoint with the recording settings — the same parameters, in JSON.
Agent version: since v1.5.0 the LT310 series is named LT300, so this guide uses
lt300:
URLs and the
lt300agent
command. With an older agent, replace them with
lt310:
and
lt310agent
.
2Your first MP4
$ ecurl rec lt300:/0/hdmi-in/0/file -d media=video/mp4
Without other parameters the input is recorded at its own resolution and frame rate. Add
location
to choose the folder; files are named with the date and time, for example
VID_20250919_172235_449.mp4
:
$ ecurl rec lt300:/0/sdi-in/0/file -d media=video/mp4 -d location=/data/videos
You can also force a size or frame rate with
size
and
framerate
.
3Choose the hardware encoder
Encoder settings go in the
extra
object; with
ecurl
you write them as
extra.<name>
:
| Setting | Values | Notes |
|---|---|---|
extra.hw
|
nvenc
,
qsv
,
amf
| NVIDIA NVENC, Intel Quick Sync, AMD AMF |
extra.codec
|
h264
,
hevc
| HEVC gives smaller files at the same quality |
extra.preset
|
veryfast
…
veryslow
| Speed / compression trade-off |
extra.gop
| frames | Keyframe interval |
# HEVC on an NVIDIA GPU
$ ecurl rec lt300:/0/sdi-in/0/file \
-d media=video/mp4 \
-d extra.hw=nvenc \
-d extra.codec=hevc
# H.264 on an Intel iGPU
$ ecurl rec lt300:/0/sdi-in/0/file \
-d media=video/mp4 \
-d extra.hw=qsv \
-d extra.codec=h264
Hardware encoder support depends on your platform and agent version: release 1.3.0 notes that hardware acceleration on Linux then worked only with Intel Quick Sync. Check the release notes of your version. On Jetson, the Orin Nano modules have no hardware encoder (NVENC) — the Orin NX modules do.
Since v1.5.0 you can also give hardware encoding priority for H.264 and HEVC when the system supports it.
4Bitrate or quality
Use one of the two rate-control modes, never both:
| Mode | Setting | Result |
|---|---|---|
| Constant bitrate |
extra.bitrate
in bits per second | Predictable file size, e.g.
20000000
= 20 Mbps |
| Constant quality |
extra.quality
from 19 to 24 | Variable bitrate, steady image quality; lower = better quality |
# 4K HEVC at a constant 20 Mbps
$ ecurl rec lt300:/0/sdi-in/0/file \
-d media=video/mp4 \
-d extra.hw=nvenc \
-d extra.codec=hevc \
-d extra.bitrate=20000000
# Constant quality, slower preset for smaller files
$ ecurl rec lt300:/0/sdi-in/0/file \
-d media=video/mp4 \
-d extra.hw=nvenc \
-d extra.codec=hevc \
-d extra.quality=21 \
-d extra.preset=slow
5Long recordings and file splitting
Three settings control how long you record and how files are cut:
| Setting | Unit | Default |
|---|---|---|
duration
| seconds — total recording time |
0
= until stopped |
splitDuration
| seconds — start a new file every N seconds |
0
= no split |
splitSize
| bytes — start a new file when it reaches this size |
0
= no split |
# Record 8 hours in 10-minute files
$ ecurl rec lt300:/0/sdi-in/0/file \
-d media=video/mp4 \
-d location=/data/videos \
-d duration=28800 \
-d splitDuration=600
# New file every 4 GB
$ ecurl rec lt300:/0/sdi-in/0/file -d media=video/mp4 -d splitSize=4000000000
Each new segment gets its own timestamped name, so files never overwrite each other.
6Record several inputs at once
Each input has its own file worker, so you can record several inputs in parallel — for example the four SDI inputs of an LT311:
$ for i in 0 1 2 3; do
ecurl rec lt300:/0/sdi-in/$i/file \
-d media=video/mp4 \
-d extra.hw=nvenc \
-d extra.codec=hevc \
-d location=/data/sdi$i &
done
Each hardware-encoded stream uses an encoder session on the GPU. Consumer GPUs can limit the number of simultaneous sessions, so check your GPU's limits before encoding many 4K streams at once.
Audio can be recorded too: audio file workers support
audio/wav
,
audio/aac
and
audio/pcm
, and since v1.5.0 MP4 files can carry audio and video together.
7Recording from your own code
In your application, create the file worker with a POST request on the input's
/file
endpoint. This is the JSON body; send it from the SDK (Go, C++, Python, C#) or with
ecurl post … -d @rec.json
:
{
"media": "video/mp4",
"location": "/data/videos",
"duration": 0,
"splitDuration": 600,
"splitSize": 0,
"extra": {
"hw": "nvenc",
"codec": "hevc",
"bitrate": 20000000,
"gop": 60,
"preset": "fast"
}
}
The agent answers with a redirect to the new worker. Then:
- Poll the worker with GET requests: you get the current file
nameandlocation, the elapsedduration, thestatus(running,paused,completed— brieflycompletedbefore each split) and the video metadata of the stream. - Send commands with a POST on
<worker URL>/stop,/pauseor/start. - Keep polling until the agent returns EOF: that is the signal the worker has finished and the last file is closed.
Complete examples in every language are in the SDK, and the request format is detailed in the API programmer guide.
8Troubleshooting
- Nothing is recorded: check the input with
ecurl get lt300:/0/sdi-in/0— the videosignalmust belocked. - ecurl does not answer: the agent must be running (
lt300agent status). Right after start-up it may be updating the board firmware for up to 2 minutes. - Encoder error: try another
extra.hwvalue, or remove it to check that recording works without hardware encoding. - Files too large or too small: switch between
extra.bitrateandextra.quality— not both at once.
Building a recording product?
Let's size your system together
Number of inputs, resolution, codec and GPU: our engineers help you choose the right board and host.