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.

Level: intermediateTime: about 20 minutesHardware: LT311, LT312 or LT313Tools: ecurl or the SDK

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 press Ctrl+C .
  • From your application by sending a POST request to the input's /file endpoint 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

bash
$ 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 :

bash
$ 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> :

SettingValuesNotes
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 framesKeyframe interval
bash
# 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:

ModeSettingResult
Constant bitrate extra.bitrate in bits per secondPredictable file size, e.g. 20000000 = 20 Mbps
Constant quality extra.quality from 19 to 24Variable bitrate, steady image quality; lower = better quality
bash
# 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:

SettingUnitDefault
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
bash
# 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:

bash
$ 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 :

json · POST lt300:/0/sdi-in/0/file
{
"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 name and location , the elapsed duration , the status ( running , paused , completed — briefly completed before each split) and the video metadata of the stream.
  • Send commands with a POST on <worker URL>/stop , /pause or /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 video signal must be locked .
  • 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.hw value, or remove it to check that recording works without hardware encoding.
  • Files too large or too small: switch between extra.bitrate and extra.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.