Each beatmap has a file size limit dictated by its total length, and any video and audio content must meet format, resolution, and bit rate requirements.
This guide will help you get your beatmap under that limit and meet such requirements.
There are 2 types of compression, lossless and lossy:
The process of converting between audio and video formats, to reduce file size, average bit rate, or resolution, is called re-encoding or transcoding. Re-encoding an already lossy-compressed audio or video using lossy compression can result in varying degrees of further quality reduction, depending on the settings used.
Due to that reason, re-encoding should be avoided, except if the original audio or video file is any of the following:
In case re-encoding is necessary, it is suggested to use the highest-quality source file available, i.e. with the highest resolution and/or bit rate.
osu! supports video encoded in the H.264 format with the .mp4
file extension. Other formats, such as H.265, VP9, and AV1, and file extensions such as .mkv
and .mov
, are currently not supported.
The ranking criteria specify a maximum video resolution of 1280x720 pixels.
To begin, download and install Handbrake, then follow these steps:
File
option, then selecting the file to import.Importing the video into Handbrake
Fast 720p30
preset.Selecting the preset
Audio
tab and remove all audio tracks. Do the same for any subtitles by going into the Subtitles
tab and removing all entries.Removing the audio tracks
Video
tab and use the following settings:
Video Encoder
set to H.264 (x264)
to encode in the H.264 format using the x264 encoderFramerate (FPS)
set to Same as source
with Constant Framerate
selectedConstant Quality
set to a value between 20 to 25. Smaller value will result in larger, higher quality filesEncoder Preset
under Encoder Options
(Veryslow
is recommended). Slower presets result in better video quality and may also reduce video file size.
Placebo
preset, as it takes much longer to encode than Veryslow
for very little improvement in quality or file size.Setting the video codec and constant quality
Dimensions
tab and change the width to 1280
and the height to 720
.Setting the video dimensions
Start Encode
.Encoding and saving the video
FFmpeg is a program used through a command-line interface (CLI), meaning it does not have any graphical interface by itself. While this may seem intimidating, FFmpeg can offer more flexibility than other tools, such as when integrated into a script.
To install FFmpeg on Windows, download FFmpeg and add its directory to your PATH
environment variable. On macOS, you can alternatively install it using the brew package manager. On Linux, most Linux distributions either already provide or pre-install FFmpeg by default (if not, research about the distribution you use for more information).
To use FFmpeg to re-encode a video file, open a terminal and paste in the following command, changing the values as needed:
ffmpeg -i input -c:v libx264 -crf 20 -preset veryslow -vf scale=-1:720 -an -sn -map_metadata -1 -map_chapters -1 output.mp4
-i input
: Your source file. If the file name contains spaces, wrap it in double quotes ("
)-c:v libx264
: Specify that the video should be encoded using the x264 encoder, producing video in the H.264 format-crf 20
: The compression quality, where lower values give better quality at the expense of larger files and vice versa. The recommended range is around 20-25-preset veryslow
: Specify an encoding preset, with recommended values ranging from ultrafast
to veryslow
. Slower presets allow the encoder to give you higher quality for the same bit rate, or lower bit rate for the same quality. More information about available presets can be found on FFmpeg's official website
-vf scale=-1:720
: Downscale the video to a height of 720 pixels. The -1
lets FFmpeg automatically determine the width of the new video based on the aspect ratio of the source-an -sn
: Remove audio and subtitles if present-map_metadata -1 -map_chapters -1
: Remove metadata and chapters if presentoutput.mp4
: Your output file. If the file name contains spaces, wrap it around double quotes ("
)Audio encoded in either MP3 or OGG (Vorbis) formats is supported with .mp3
and .ogg
file extensions, respectively. Other formats are currently not supported (except for audio with the .wav
file extension for hitsounds).
Generally, OGG (Vorbis) results in better quality than MP3 for a given bit rate.
The ranking criteria specifies that average bit rate must be between 192kbps and 128kbps. As a reference, Featured Artists songs included in the beatmap templates are encoded with a constant bit rate of 192kbps.
See also: Audio editing guide
To begin, download and install Audacity, then follow these steps:
Importing audio into Audacity
Export as MP3
Preset
and select the quality of Medium, 145-185 kbps
Quality
slider at 5
, which is the default valueSave
, and a new dialog will appear for you to enter audio metadata.Export settings
OK
to start re-encoding.Note: Clicking Cancel
in the metadata dialog will abort the re-encoding process.
For instructions on installing FFmpeg, see: Video/Using FFmpeg
After installing FFmpeg, open a terminal, then use one of the below commands.
To encode in the MP3 format, paste the following command into your terminal and change these values as needed:
ffmpeg -i input -c:a libmp3lame -q:a 4 -vn -sn -map_metadata -1 -map_chapters -1 output.mp3
-i input
: Your source file. If the file name contains spaces, wrap it in double quotes ("
)-c:a libmp3lame
: Specify that the audio should be encoded using the LAME MP3 encoder-q:a 4
: Use the same variable bit rate range as in the Audacity example, where a lower number means higher bit rate. If you want constant bit rate, you would instead use for instance -b:a 128k
for a constant 128kbps bit rate-vn -sn
: Remove video and subtitles if present-map_metadata -1 -map_chapters -1
: Remove metadata and chapters if presentoutput.mp3
: Your output file. If the file name contains spaces, wrap it in double quotes ("
)To encode in the OGG (Vorbis) format, paste the following command into your terminal and change these values as needed:
ffmpeg -i input -c:a libvorbis -q:a 5 -vn -sn -map_metadata -1 -map_chapters -1 output.ogg
-i input
: Your source file. If the file name contains spaces, wrap it in double quotes ("
)-c:a libvorbis
: Specify that the audio should be encoded using the libvorbis encoder-q:a 5
: Use the same variable bit rate range as in the Audacity example, where a higher number means higher bit rate. If you want constant bit rate, you would instead use for instance -b:a 128k
for a constant 128kbps bit rate-vn -sn
: Remove video and subtitles if present-map_metadata -1 -map_chapters -1
: Remove metadata and chapters if presentoutput.ogg
: Your output file. If the file name contains spaces, wrap it in double quotes ("
)It is recommended to check the technical information of re-encoded audio and video files to confirm that they meet your expectations.
MediaInfo is very easy to use. After installing, open the file with MediaInfo and the technical information about that file will appear.
File
-> Open
-> Open file(s)...
in MediaInfo.Basic
to either Tree
, Text
, or HTML
. The default Basic
view only displays a condensed series of information.Relevant fields for video files:
Format
and Format/Info
, which must be AVC
and Advanced Video Codec
, respectivelyWidth
, which must be at or below 1280 pixels
Height
, which must be at or below 720 pixels
Frame rate mode
, which must be Constant
Relevant fields for audio files:
Overall bitrate
, which must be between 192kbps
and 128kbps
, as specified in the ranking criteriaFormat
, which must be MPEG Audio
Format profile
which must be Version 1
Format settings
which must be Layer 3
Format
, which must be both OGG
and Vorbis
If everything seems correct and the file size is small enough, then you can put either re-encoded audio or video file into your beatmap.