Skip to content

Use compressed mp4 file when available to save 98% on storage, and 99% in memory #1035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jtmckay
Copy link

@jtmckay jtmckay commented Apr 25, 2025

What this does

This will setup ReRun to use the MP4 file if it is available to take advantage of MP4 compression, instead of converting every frame into a full pixel map. It will fallback to full pixels if the file is not found.

image
99% memory reduction in memory on the client.

How it was tested

I ran the code locally with a dataset that has mp4 files. Then commented out the part that adds the mp4, to ensure the fallback works.

Examples:

  • Optimized visualize, it now runs with 98-99% less memory than previously.

How to checkout & try? (for the reviewer)

With a lerobot dataset to see disk space saved, run

python lerobot/scripts/visualize_dataset.py \
    --repo-id lerobot/pusht \
    --episode-index 0 \
    --save 1 \
    --output-dir path/to/directory

To see memory saved, run rerun (pre-req rerun-sdk) and open the .rrd file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant