-
Notifications
You must be signed in to change notification settings - Fork 5
Recording
im-pingo edited this page Mar 26, 2026
·
2 revisions
English | 中文
LiveForge can record live streams to FLV files with duration-based segmentation and path templates.
record:
enabled: false
stream_pattern: "live/*"
format: flv
path: "/data/record/{date}/{stream_key}_{time}.flv"
segment:
mode: duration
duration: 30m
max_size: 512MB
on_file_complete:
url: ""| Field | Type | Default | Description |
|---|---|---|---|
enabled |
bool | false |
Enable/disable recording |
stream_pattern |
string | "live/*" |
Glob pattern to match stream keys for recording. "*" records all streams. |
format |
string | "flv" |
Recording file format |
path |
string | See above | Output file path template |
segment.mode |
string | "duration" |
Segmentation mode |
segment.duration |
duration | 30m |
Segment duration before starting a new file |
segment.max_size |
string | "512MB" |
Maximum segment file size |
on_file_complete.url |
string | "" |
HTTP callback URL to invoke when a recording file is complete |
The path field supports the following template variables:
| Variable | Description | Example |
|---|---|---|
{stream_key} |
Full stream key | live/stream1 |
{date} |
Current date | 2026-03-26 |
{time} |
Current time | 143000 |
/data/record/{date}/{stream_key}_{time}.flv
Produces: /data/record/2026-03-26/live/stream1_143000.flv
When on_file_complete.url is set, LiveForge sends a POST request to that URL each time a recording segment finishes.
Callback Payload:
{
"stream_key": "live/stream1",
"file_path": "/data/record/2026-03-26/live/stream1_143000.flv",
"duration": 1800,
"bytes": 524288000
}This enables post-processing workflows such as uploading to cloud storage, transcoding, or updating a media catalog.
- When a stream matching
stream_patternstarts publishing, a recording session is created - Frames from the stream are written to FLV files
- A new segment file is created when
segment.durationelapses orsegment.max_sizeis reached - When the publisher stops, the recording session ends and the final segment is closed
- Live event archiving -- record streams for on-demand replay
- Security camera DVR -- continuous recording with duration-based segmentation
- Compliance recording -- capture all streams matching a pattern with automated post-processing