Skip to content

Add RecordVideo wrappers#1306

Open
nightly wants to merge 7 commits intoFarama-Foundation:masterfrom
nightly:feat/record-video-wrapper
Open

Add RecordVideo wrappers#1306
nightly wants to merge 7 commits intoFarama-Foundation:masterfrom
nightly:feat/record-video-wrapper

Conversation

@nightly
Copy link
Copy Markdown

@nightly nightly commented Aug 24, 2025

Description

Provides a direct port of the RecordVideo wrapper from Gymnasium to PettingZoo. Currently, you'd have to implement your own wrapper for this or rely on a wrapper from something like SB3 or TorchRL.

List of changes:

  • Implements the wrappers separately for base/AEC environment type and parallel environment type, as done so for other wrappers in the repo.
  • Updates pyproject.toml for pettingzoo[other] packages to add MoviePy which is needed for rendering/recording.
  • Adds a new test file for the Record Video wrappers, testing both AEC and Parallel on Piston Ball (this test is also adapted from Gymnasium).

Some documentation needs to be added (this can be done if the contribution itself is approved). One improvement would be abstracting out some of the logic between the two wrappers, but I've left it as-is for now.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have run pytest -v and no errors are present.
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I solved any possible warnings that pytest -v has generated that are related to my code to the best of my knowledge.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

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