Callaba

RTSP Recording: Segments, Retention & Recovery | Callaba

Aug 08, 2026

RTSP recording turns a live session into files that can be found, decoded, retained and deleted predictably. The recorder first has to negotiate the RTSP resource and receive its RTP media. It then preserves or transforms the tracks, writes a container, closes each segment cleanly and exposes evidence that the output actually advanced. A connected input alone is not a valid recording.

A recording is a lifecycle, not a long-running socket

RTSP recording from session to retained file A recorder authenticates to an RTSP source, negotiates RTP media, validates tracks and timestamps, writes closed file segments, verifies each asset, and applies retention and deletion rules. RTSP SOURCEauth · sessionRTP tracks MEDIA GATEcodec · track maptimestamps · healthcopy or transcodefirst output evidence SEGMENT WRITERcontainer · durationsafe close · namingrestart boundarypartial file policy MANAGED ASSETSprobe · inventory · downloadretention · archive · deleteowner · audit · restore testusable after the live job stops
Every completed segment needs media and storage evidence before retention policy can be trusted.

Callaba already records RTSP inputs as a managed workflow

The Callaba Recording API accepts an RTSP URL input, supports continuous or timed file clips, retention and automatic deletion, an optional backup source, optional media processing and live statistics. Completed files appear with the recording job and can be managed through File Manager. This is an existing RTSP recording path. It is not a promise that every camera codec, RTSP authentication method, storage mount or damaged source will work without validation.

Recording stageExisting Callaba actionAcceptance evidence
SourceCreate the Recording with the approved RTSP URL and selected input typeBitrate, FPS and output time advance from the expected tracks
File productionSelect output format, continuous or timed clips and only required processingA closed file has expected duration, codecs, tracks and seek behavior
LifecycleApply retention and use recordedFiles or File Manager for produced assetsInventory, storage and deletion state converge under the stated policy

The adjacent improvement is a source-to-file incident timeline that correlates RTSP control, RTP continuity, recorder progress, segment close, storage commit and retention action. The recording feature itself should remain visible as implemented rather than described as a future integration.

Validate the RTSP source before choosing file settings

Resolve the exact resource, credential owner, permitted client count and transport mode. Capture the presentation description, selected video and audio tracks, codec profiles, frame and sample rates, and timestamp behavior. The RTSP camera workflow covers acquisition; the recorder begins where a stable, authorized source is available.

RTSP 2.0 controls the session, while negotiated media commonly uses RTP. Record control responses and packet arrival separately. A successful PLAY does not prove that UDP packets reach the recording host.

Copy tracks when compatible; transcode for a named reason

Stream copy avoids a new lossy generation and reduces compute, but the selected container must accept the source codecs, timing and track layout. Transcode only for an explicit output requirement: codec compatibility, normalized dimensions or frame rate, audio layout, overlay, bitrate or damaged timing that a defined process can repair.

Keep the decision per track. Video may be copied while audio is transcoded, or an unwanted metadata track may be excluded. After start, compare the actual output probe with the declared map. A configuration field is intent; the file is evidence.

Segment length determines the recovery and operations unit

Short clips bound the amount of material at risk when a process or host fails and let downstream systems consume finished assets sooner. They also create more files, metadata operations and boundary opportunities. Long clips reduce object count but enlarge the unclosed interval and delay validation.

Choose segment duration from recovery point, archive workflow and programme boundaries rather than a convenient round number. Define filename uniqueness across restarts and daylight-saving changes. Record timestamps in an unambiguous clock domain and preserve the source-to-file relationship.

Closed files and partial files need different policy

A container may need final indexes or metadata written at close. If the recorder stops abruptly, the newest file may be absent, truncated or require repair. Do not present it beside verified assets until the selected format passes a probe. Keep partial output in an isolated state with a bounded repair or deletion process.

For each completed segment, check non-zero size, duration range, expected tracks, monotonic timestamps and a representative decode. File creation time alone cannot distinguish usable content from a header-only artifact.

Retention starts from an explicit event

Name whether age begins at segment open, close, inventory registration or programme end. State whether retention applies to local working files, archives and derived copies. Legal hold and incident preservation must override ordinary deletion through an authorized, auditable path.

Callaba can apply recording retention and automatic deletion within the documented job lifecycle. When files are copied elsewhere, the receiving storage and catalog need their own verified expiry. The File Manager guide owns managed asset operations; it does not prove deletion from untracked copies.

Example: the recorder is running, but the newest file is frozen

The job remains active and its RTSP connection has not closed, yet the latest clip duration stops growing after a camera reboot. The first comparison is recorder out_time_ms and file size beside RTP packet arrival and timestamps from the same interval. If packets resumed with a discontinuous clock that the muxer did not accept, the root cause is at the source-timestamp-to-container boundary—not storage capacity merely because no new bytes appear.

Design backup and reconnect behavior before the incident

A backup source must represent the same intended programme and a compatible track contract. Decide how the recorder detects primary failure, whether a switch opens a new file, how it marks discontinuity and when primary service may return. “Backup configured” does not imply seamless media.

Test source loss, credential denial, UDP blockage, camera restart, recorder restart and storage interruption separately. Observe time to new bytes, damaged interval, segment naming and which source produced each file. Keep the result with the runbook.

Commission recording through file deletion

  1. Create one controlled job. Use the Recording API with an approved source, format, segment and retention contract.
  2. Verify live progress. Check bitrate, FPS, speed and output time; do not rely on active state alone.
  3. Probe completed files. Validate duration, tracks, codecs, timestamps, seek and representative decode.
  4. Interrupt the source. Bound the missing interval and prove reconnect and partial-file behavior.
  5. Exercise the backup. Identify the selected source and validate the first closed file after transition.
  6. Prove retention. Let a test asset expire and confirm it leaves the managed inventory and intended storage boundary.

RTSP recording FAQ

Does RTSP itself define the recording file format?

No. RTSP controls a media session. The recorder chooses a compatible output container, track mapping and processing policy for the received media.

Should every RTSP recording be transcoded?

No. Copy compatible tracks when that meets the output contract. Transcode only when a codec, media property, overlay or destination requirement demands it.

What segment duration is best?

There is no universal value. Balance recoverable loss, time to a closed asset, file count, archive behavior and programme boundaries, then test failure at a segment transition.

Can active status prove that recording is healthy?

No. Confirm that output time and bytes advance, then probe a completed file. A process can remain active while its input, timestamps or storage output has stalled.

Define the managed recording lifecycle Create and observe the RTSP recording Validate and manage completed files