Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:CARLA simulator Carla Client Show Recorder File Info

From Leeroopedia
Knowledge Sources
Domains Simulation, Recording
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete tool for inspecting the metadata and contents of a CARLA recording file without replaying it provided by the CARLA simulator.

Description

The Client.show_recorder_file_info method parses a CARLA recording file and returns a human-readable string summarizing its contents. The summary includes the map name, total duration, total frames, and a chronological listing of events such as actor spawns, actor destructions, and traffic light state changes.

When show_all is set to True, the output additionally includes per-frame details such as actor positions, velocities, and states. This verbose mode produces significantly more output but provides complete frame-level visibility into the recording's contents.

The returned string is formatted for direct printing to the console and follows a structured text format that can also be parsed programmatically for automated analysis pipelines.

Usage

Call this method to preview a recording file before replaying it. It is useful for identifying the time ranges of interest, finding specific actor IDs for the follow_id parameter in replay_file, verifying that a recording captured the expected scenario, and cataloging recordings in batch processing workflows.

Code Reference

Source Location

  • Repository: CARLA
  • File: PythonAPI/carla/src/Client.cpp:L206, LibCarla/source/carla/client/Client.h:L129-131

Signature

Client.show_recorder_file_info(filename: str, show_all: bool) -> str

Import

import carla

I/O Contract

Inputs

Name Type Required Description
filename str Yes Path or name of the recording file to inspect. If relative, the server searches its default recording directory.
show_all bool Yes When True, includes per-frame actor positions and states in the output. When False, shows only event-level summaries (spawns, destroys, state changes).

Outputs

Name Type Description
return str A formatted multi-line string containing the recording metadata, event timeline, and optionally per-frame details.

Usage Examples

Basic Example

import carla

client = carla.Client('localhost', 2000)
client.set_timeout(10.0)

# Get a summary of the recording (events only)
info = client.show_recorder_file_info("traffic_scenario_01.log", show_all=False)
print(info)

# Example output:
# Version: 1
# Map: Town03
# Date: 02/15/2026 10:30:00
#
# Frame 1 at 0.00 seconds
#   Create 42: vehicle.tesla.model3 (1)
#   Create 43: vehicle.audi.a2 (2)
#   ...
# Frame 50 at 2.50 seconds
#   Destroy 42
#   ...
# Frames: 1200
# Duration: 60.00 seconds

Verbose Inspection for Actor ID Discovery

import carla

client = carla.Client('localhost', 2000)
client.set_timeout(30.0)

# Get full per-frame details
full_info = client.show_recorder_file_info("traffic_scenario_01.log", show_all=True)

# Parse the output to find a specific vehicle type
lines = full_info.split('\n')
tesla_actors = [line for line in lines if 'tesla' in line.lower()]

for line in tesla_actors:
    print(line)

# Use discovered actor IDs for targeted replay
# e.g., if Tesla has ID 42, replay following that vehicle:
# client.replay_file("traffic_scenario_01.log", 0.0, 60.0, 42)

Recording Catalog Script

import carla
import os

client = carla.Client('localhost', 2000)
client.set_timeout(10.0)

recording_dir = "/home/carla/recordings/"
recordings = [f for f in os.listdir(recording_dir) if f.endswith('.log')]

catalog = []
for rec_file in recordings:
    info = client.show_recorder_file_info(rec_file, show_all=False)
    # Extract duration from the info string
    for line in info.split('\n'):
        if 'Duration' in line:
            duration = line.strip()
            break
    catalog.append({"file": rec_file, "duration": duration})
    print(f"{rec_file}: {duration}")

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment