Compressing files
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.
Introduction
There are 2 types of compression, lossless and lossy:
- Lossless compression implies that the quality never degrades and can thus be repeatedly compressed and decompressed
- Lossy compression uses certain powerful techniques to greatly reduce file size at the expense of quality
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:
- Too large in file size
- Too high of a resolution or average bit rate
- Encoded in an incompatible format
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.
Video
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.
Using Handbrake
To begin, download and install Handbrake, then follow these steps:
- Open Handbrake, then import your video file by either:
- Drag-and-dropping the file into Handbrake, or
- Clicking the
Fileoption, then selecting the file to import.

- Select the
Fast 720p30preset.

- Select the
Audiotab and remove all audio tracks. Do the same for any subtitles by going into theSubtitlestab and removing all entries.

- Go into the
Videotab and use the following settings: -Video Encoderset toH.264 (x264)to encode in the H.264 format using the x264 encoder -Framerate (FPS)set toSame as sourcewithConstant Framerateselected -Constant Qualityset to a value between 20 to 25. Smaller value will result in larger, higher quality files - Depending on how long you are willing to spend time encoding, change the
Encoder PresetunderEncoder Options(Veryslowis recommended). Slower presets result in better video quality and may also reduce video file size. - Do not use thePlacebopreset, as it takes much longer to encode thanVeryslowfor very little improvement in quality or file size.

- To resize the image of the video file, go to the
Dimensionstab and change the width to1280and the height to720.

- Lastly, pick the location you want to save your result to, then click
Start Encode.

Using FFmpeg
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 fromultrafasttoveryslow. 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-1lets 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
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 for MP3 format, and between 208kbps and 128kbps for OGG (Vorbis) format. As a reference, Featured Artists songs included in the beatmap templates are encoded to MP3 with a constant bit rate of 192kbps.
Using Audacity
See also: Audio editing guide
To begin, download and install Audacity, then follow these steps:
- Open Audacity, then import the audio file into Audacity.

- Export the audio as either MP3 or OGG.

- Change the export options to compress your file, depending on selected format:
- For MP3, change the bit rate mode to
Constantand select the quality of192 kbps- For OGG (Vorbis), adjust theQualityslider to6, which sets the average bit rate to 192 kbps - Select the output location and click
Save, and a new dialog will appear for you to enter audio metadata.

- Once done entering metadata, which can be left blank if desired, click
OKto start re-encoding.
Notice
Clicking Cancel in the metadata dialog will abort the re-encoding process.
Using FFmpeg
Note: 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 -b:a 192k -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-b:a 192k: Set the bit rate to a constant 192kbps. If you want variable bit rate, you would instead use for instance-q:a 2for average 192 kbps (the lower number means higher 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 6 -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 6: 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 192kfor a constant 192kbps 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 (")
Verification
It is recommended to check the technical information of re-encoded audio and video files to confirm that they meet your expectations.
Using MediaInfo
MediaInfo is very easy to use. After installing, open the file with MediaInfo and the technical information about that file will appear.
- Right-click any file and select MediaInfo from the context menu, or use
File->Open->Open file(s)...in MediaInfo. - Change the view from
Basicto eitherTree,Text, orHTML. The defaultBasicview only displays a condensed series of information.
Relevant fields for video files:
FormatandFormat/Info, which must beAVCandAdvanced Video Codec, respectivelyWidth, which must be at or below1280 pixelsHeight, which must be at or below720 pixelsFrame rate mode, which must beConstant
Relevant fields for audio files:
Overall bitrate, which must be between192kbpsand128kbps, as specified in the ranking criteria- For MP3, make sure to look for:
Format, which must beMPEG AudioFormat profilewhich must beVersion 1Format settingswhich must beLayer 3- For OGG (Vorbis), make sure to look for:
Format, which must be bothOGGandVorbis
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.