phichain-renderer is a headless rendering tool that converts Phichain projects into video files. It uses the same game engine as the playable version to ensure accuracy.
Installation
The renderer requires FFmpeg to be installed on your system:Usage
Basic Syntax
Arguments
The path to the Phichain project directory (not the chart file).
The path where the output video will be saved.
The start time of the chart to render in seconds. Defaults to the beginning.
The end time of the chart to render in seconds. Defaults to the music duration.
Video Options
The width of the output video in pixels.
The height of the output video in pixels.
The frame rate of the output video.
Game Options
Customize the visual appearance of the rendered chart:Scale factor for notes. Values above 1.0 make notes larger, below 1.0 make them smaller.
Enable the FC/AP indicator. Since the renderer uses autoplay, this will always show a perfect score.
Disable multi-hit highlight effects for notes.
Hide the visual effects when notes are hit.
Override the chart name displayed in the video.
Override the difficulty level displayed in the video.
Examples
Basic Rendering
Render a complete chart with default settings:output.mp4 (1920x1080, 60fps)
Custom Output Path
Render Specific Section
Render only a portion of the chart (e.g., from 30 seconds to 90 seconds):4K Resolution
Custom Game Settings
Override Chart Metadata
Performance
The renderer displays real-time performance information during rendering:Performance metrics are updated every 100 frames. The
estimate to end shows the approximate remaining time based on current rendering speed.Performance Information
- Frame Progress - Current frame / Total frames
- Percentage - Completion percentage
- FPS - Current rendering speed in frames per second
- Multiplier - Speed relative to target FPS (e.g., 1.0x means real-time)
- Estimate - Estimated time remaining in seconds
Output Format
The renderer outputs H.264 encoded MP4 files using FFmpeg:- Video codec: libx264
- Pixel format: RGBA (converted to H.264)
- No audio: The renderer only outputs video (you’ll need to add audio separately)
The renderer does not include audio in the output video. You’ll need to merge the audio track separately using FFmpeg or video editing software.
Adding Audio to Rendered Video
Rendering Pipeline
The renderer works by:- Loading - Load the Phichain project and chart data
- Setup - Initialize the game engine and rendering pipeline
- Pre-roll - Render 40 frames to warm up (not saved)
- Capture - Render each frame and pipe to FFmpeg
- Encode - FFmpeg encodes frames to H.264 video
- Complete - Display total render time
Tips
- Hardware acceleration: The renderer uses GPU acceleration when available
- Render time: Expect rendering to take 1-2x the chart duration on modern hardware
- Memory usage: Higher resolutions and FPS require more memory
- Batch rendering: Use shell scripts to render multiple charts automatically
Batch Rendering Example
Common Issues
FFmpeg Not Found
Low Performance
If rendering is very slow:- Try lowering the resolution (
--width 1280 --height 720) - Reduce FPS (
--fps 30) - Close other GPU-intensive applications
Memory Errors
For very long charts or high resolutions, you may encounter memory issues. Try:- Rendering in segments using
--fromand--to - Reducing resolution temporarily
- Increasing system swap/page file size
See Also
- Converter Tool - Convert charts between formats
- Project API - Phichain project structure
- Game API - Game engine configuration