Expand description
Video export module for the NES emulator CLI.
This module provides video encoding capabilities for exporting emulator frame buffers to various video formats.
§Supported Formats
| Format | Implementation | Dependencies |
|---|---|---|
| PNG sequence | Pure Rust (image crate) | None - self-contained |
| PPM sequence | Pure Rust | None - self-contained |
| MP4 | FFmpeg subprocess | FFmpeg installed |
| Raw | Writes raw BGRA bytes | None |
§Scaling
Video scaling is handled natively by FFmpeg using the nearest neighbor filter, which preserves sharp pixel edges for retro games.
Structs§
- Ffmpeg
Mp4Encoder - Encoder that pipes frames to FFmpeg for MP4 encoding.
- FpsConfig
- Parsed FPS configuration.
- PngSequence
Encoder - Encoder that outputs a sequence of PNG images.
- PpmSequence
Encoder - Encoder that outputs a sequence of PPM images.
- RawEncoder
- Encoder that outputs raw BGRA frames.
- Streaming
Video Encoder - A streaming video encoder that handles scaling via FFmpeg.
Enums§
- Video
Error - Video encoding error
- Video
Resolution - Target video resolution for output.
Constants§
- NES_
NTSC_ FPS - NES NTSC framerate: 39375000 / 655171 ≈ 60.098814
- NES_
NTSC_ FPS_ DEN - NES_
NTSC_ FPS_ NUM - NES NTSC framerate as exact numerator/denominator
- SMOOTH_
FPS - Smooth framerate target (exactly 60 fps)
Traits§
- Video
Encoder - Trait for video encoders.
Functions§
- create_
encoder - Create a video encoder for the specified format.
- create_
encoder_ with_ scale - Create an MP4 encoder with FFmpeg native nearest-neighbor scaling.
- encode_
frames - Encode collected frames to video.
- is_
ffmpeg_ available - Check if FFmpeg is available for MP4 encoding.