MikuMikuDance Load Background AVI Encoded By FFMpeg

MikuMikuDance (MMD) can only load AVI videos container instead MP4. There were no AVI codec spec that the application support, BUT its depend on what decoder installed on your System/Windows.

To support to decode H264, install x264vfw (video for windows). After some experiment with FFMpeg the decoder seems works well with baseline profile instead main or high.

> ffmpeg -i "INPUT.mp4" -c:v libx264 -profile:v baseline <VIDEO_OPTS> <AUDIO_OPTS> "OUTPUT.avi"

The VIDEO_OPTS and AUDIO_OPTS are optional or may be omitted.

For VIDEO_OPTS values:

  • 30 fps video: -filter:v fps=30
  • enable opencl: -x264opts opencl

For AUDIO_OPTS values:

To cut the video refer to “-ss” and “-t” options, see: https://trac.ffmpeg.org/wiki/Seeking

If you have nVidia GPU cards, change -c:v libx264 into -c:v h264_nvenc to enable using GPU encoder.