MMD2FFMPEG is a 64-bit DirectX Media Object (DMO) encoder for MikuMikuDance 9.32 x64. It sends MMD-rendered RGB frames directly to FFmpeg, replacing the oversized AVI workflow with an MKV video produced beside the AVI path selected in MMD. It can also read audio embedded in MMD's AVI and mux it into the final MKV.
- Appears in MMD's AVI encoder list as MMD2FFMPEG DMO Encoder.
- Streams MMD's RGB24 frames to FFmpeg through stdin.
- The MKV uses the same name and folder as MMD's AVI output. After a successful FFmpeg encode, MMD2FFMPEG automatically removes MMD's placeholder AVI; the AVI is preserved if encoding fails.
- After video encoding, can read audio embedded in MMD's AVI and mux it into the MKV as FLAC, WAV/PCM, or no audio.
- Includes an optional Hi-Res audio mode: audio below 48 kHz is encoded at twice its original sample rate and 24-bit depth.
- Writes the MKV
DATE_RECORDEDmetadata field automatically when encoding starts, using the local date inyyyy-M-dformat. - Supports CPU software encoding, NVIDIA NVENC, Intel Quick Sync, and AMD AMF through FFmpeg.
- Supports AVC, HEVC, and AV1; 8-bit and supported 10-bit output; CRF/CQ, constant QP, and target-bitrate modes.
- Uses the frame rate chosen by MMD and marks video as BT.709.
- Requires a successful manual encoder test before settings can be saved or applied.
- Includes Traditional Chinese, Simplified Chinese, Japanese, English, and system-default UI languages.
- Writes per-export diagnostics under
%LOCALAPPDATA%\MMD2FFMPEG\logs, including FFmpeg version, input frames, measured input FPS, elapsed time, exit code, and output size. - Includes MMD Locale Launcher, an optional companion that starts MMD through ntleas with Japanese CP932 settings and can register itself as a
.pmmopener.
- MikuMikuDance 9.32 x64.
- FFmpeg available as
ffmpeg.exeon the systemPATH. - Windows x64.
Check the FFmpeg installation before building:
ffmpeg -version-
Open the official FFmpeg download page. Its Windows section links to current prebuilt Windows packages.
-
Download an x64 build, extract it to a permanent location such as
C:\FFmpeg, and confirm thatC:\FFmpeg\bin\ffmpeg.exeexists. -
Open System Properties > Advanced > Environment Variables. Under either User variables (current user) or System variables (all users), edit
Path, choose New, and addC:\FFmpeg\bin. -
Close and reopen PowerShell, then verify the installation:
ffmpeg -version
MMD2FFMPEG runs ffmpeg.exe from PATH; do not configure a hard-coded FFmpeg path.
- Download
MMD2FFMPEG-x64.zipfrom the Releases page. - Extract the ZIP to a local folder.
- Install FFmpeg and add its
binfolder toPATHas described above. - Double-click
install-user.batin the extracted folder. It starts the installer with the required temporary PowerShell execution-policy bypass and keeps the window open so that you can read the result. - Start MMD again.
The installer registers only for the current Windows user and places the runtime files in %LOCALAPPDATA%\MMD2FFMPEG.
| File | Purpose |
|---|---|
install-user.bat |
Recommended one-click installer. Starts install-user.ps1. |
install-user.ps1 |
Copies the runtime files to the current user's local MMD2FFMPEG folder, migrates compatible configuration, and registers the DMO for the current user. |
uninstall-user.bat |
Recommended one-click uninstaller. Starts uninstall-user.ps1. |
uninstall-user.ps1 |
Removes the current user's DMO registration. Runtime files, configuration, and logs are deliberately retained for manual backup or removal. |
mmd2ffmpeg_dmo.dll |
The MMD-visible DirectX Media Object encoder. It receives MMD frames and streams them to FFmpeg to create the MKV. |
mmd2ffmpeg_cleanup.exe |
Runs after successful video encoding. It waits for MMD to release the AVI, muxes embedded audio into MKV when enabled, then deletes the placeholder AVI and records the result in the export log. |
MMDLocaleLauncher.exe |
Optional portable MMD launcher. It starts MMD via ntleas using Japanese CP932 settings and can be registered as a .pmm opener. |
-
Clone or download this repository.
-
Install Visual Studio 2022 with the Desktop development with C++ workload.
-
Close MMD completely.
-
Build and register the per-user DMO:
& 'C:\APP\MMD\MMD2FFMPEG\scripts\build.ps1' & 'C:\APP\MMD\MMD2FFMPEG\scripts\install-user.ps1'
Maintainers can create the GitHub Release asset after a successful build:
& 'C:\APP\MMD\MMD2FFMPEG\scripts\make-release.ps1'This creates release\MMD2FFMPEG-x64\ and release\MMD2FFMPEG-x64.zip.
build.ps1 runs this packaging step automatically after every successful build.
- Select File > AVI Output and choose the desired AVI save path.
- In Video encoder, select MMD2FFMPEG DMO Encoder.
- Open Detailed settings, configure the encoder, and use Test encoder.
- Save or apply only after the test passes.
- Start AVI output. The final MKV is written beside the selected AVI path; MMD's placeholder AVI is deleted automatically after successful video-only output or audio muxing.
The Audio tab controls what happens after video encoding finishes:
| Setting | Behavior |
|---|---|
| FLAC | Losslessly encodes PCM audio embedded in the AVI as FLAC and muxes it into the MKV. |
| WAV | Muxes PCM audio embedded in the AVI into the MKV. |
| None | Does not mux audio. |
| Original | Keeps the source sample rate and bit depth. |
| Hi-Res | When the source is below 48 kHz, uses twice the source sample rate and 24-bit depth for bilibili Hi-Res detection. |
For MMD to place audio in the AVI, select Include WAV in MMD's AVI output settings and export starting from frame 0. If the export begins later, the AVI exported by MMD contains no audio, so there is nothing for MMD2FFMPEG to mux. The AVI is deleted only after successful video-only completion or successful audio muxing; it is retained when muxing fails for diagnosis.
-
Update: Close MMD, run the build command, then run
install-user.batagain. Existingconfig.iniis preserved. -
Uninstall: Close MMD and double-click
uninstall-user.batin the Release package, or run from source:& 'C:\APP\MMD\MMD2FFMPEG\scripts\uninstall-user.ps1'
This removes the per-user DMO registration. Runtime files, configuration, and logs under
%LOCALAPPDATA%\MMD2FFMPEGare intentionally left in place for manual backup or deletion.
| Item | Location |
|---|---|
| Encoder settings | MMD: AVI Output > Video encoder > Detailed settings |
| Output path | The AVI path selected in MMD; MMD2FFMPEG always changes its extension to .mkv |
| Per-user configuration | %LOCALAPPDATA%\MMD2FFMPEG\config.ini |
| Per-export logs | %LOCALAPPDATA%\MMD2FFMPEG\logs |
The advanced command field exposes the editable FFmpeg video-argument section. The fixed input, color conversion, output-container arguments, and output path remain controlled by MMD2FFMPEG.
| Symptom | Check |
|---|---|
| Encoder is missing from MMD | Confirm that MMD is x64, rerun install-user.bat, then restart MMD. |
| Test encoder fails | Run ffmpeg -version; ensure the selected hardware encoder is supported by the active FFmpeg, GPU, and driver. |
| Installer cannot replace the DLL | Close every MMD window and retry the installer. |
| AVI remains or no MKV appears | Open the log folder, inspect the latest log, and check the FFmpeg exit code. |
| MKV has no audio | Enable MMD WAV/audio output and export from frame 0. Confirm that the temporary AVI contains an audio stream. |
| Very large AVI file | Ensure MMD2FFMPEG DMO Encoder is selected and MMD did not fall back to uncompressed output. |
- MMD output is SDR BT.709. HDR output is not implemented.
- Hardware encoder availability depends on the installed FFmpeg build, GPU, and driver. Use Test encoder after changing encoder settings.
- The encoder launches
ffmpeg.exefromPATH. Review custom FFmpeg arguments before saving them.
MMDLocaleLauncher.exe is for non-Japanese Windows installations where MMD needs ntleas to avoid mojibake. It uses ntleas's Japanese profile equivalent to:
ntleas.exe MikuMikuDance.exe C932 L1041 "FMS PGothic" P4
- From the extracted Release package, copy
MMDLocaleLauncher.exeinto the same folder asMikuMikuDance.exe. - On its first run, the launcher searches only its own folder for
ntleas.exeorMikuMikuDance.exe. Otherwise, select the two executable paths, then save. The paths are stored inMMDLocaleLauncherConfig.inibeside the runningMMDLocaleLauncher.exe. - After setup, double-clicking
MMDLocaleLauncher.exestarts MMD through ntleas. Opening a.pmmthrough the launcher passes that PMM to MMD using ntleas's documentedAapplication-argument option.
This is a CP932 compatibility launcher, not a full UTF-8 conversion of MMD. Paths containing characters that CP932 cannot represent may still be limited by MMD itself.

