How to Compress a Video into an MP4
Provide a nonempty valid video input, choose a quality value from 18 through 40 and a supported encoding preset, then submit it for MP4 compression. A successful result uses H.264 video and includes AAC audio when an audio stream is available.
What this video compressor does
Compress Video converts a supplied video into an MP4 with adjustable quality and encoding-speed settings. It is useful when you need a smaller video file while keeping control over the balance between output quality and processing speed.
Processing uses H.264 video encoding. If the source contains an audio stream, the MP4 output includes AAC audio. The input must be nonempty, valid, and no larger than 50 MB after decoding. A successful result also reports the original size, compressed size, and percentage reduction.
Step-by-step instructions
-
Prepare a nonempty, valid Base64-encoded media value for the video you want to compress. Although the file input is declared as optional, processing cannot proceed without a valid nonempty media value.
-
Provide the video input and set the quality control. The default quality value is 28. Use a value from 18 through 40: lower values generally represent a stronger quality preference, while higher values generally allow more compression. The value is converted to an integer, so enter a whole-number setting within that range.
-
Choose an encoding preset. The available presets are
ultrafast,superfast,veryfast,faster,fast,medium,slow,slower, andveryslow. The default ismedium, and preset matching is not case-sensitive. Faster presets prioritize encoding speed; slower presets can spend more time on encoding. -
Submit the video for processing. The tool selects the first video stream. It includes audio only when an audio stream is available. Encoding is limited to 45 seconds, so a large or complex input may not finish within the permitted processing time.
-
When processing succeeds, use the resulting MP4. Check the reported original byte size, compressed byte size, and size-reduction percentage to understand how much smaller the output is. If processing fails, review the input, quality value, preset, and processing duration before trying again.
How to read the result
The output is an MP4 using H.264 video encoding. AAC audio is present only when the supplied media includes an available audio stream, so a source without audio should not be expected to gain an audio track.
The reported size-reduction percentage is calculated from the original and compressed byte sizes and rounded to one decimal place. Treat it as a description of the completed output, not as a guaranteed target before processing. A smaller result can involve a different quality and may not look or sound identical to the source.
A failure does not produce an MP4 result. Possible causes include an unavailable video-processing engine, invalid input, an input over the 50 MB decoded limit, an unsupported preset, an encoding error, processing beyond 45 seconds, or a missing nonempty output file.
Worked example
A person has a 32 MB video and wants an MP4 with the default quality and medium encoding preset.
Provide the 32 MB video as a valid nonempty input, leave quality at 28, keep the medium preset, and submit it for processing.
A successful response contains an MP4 output using H.264 video encoding, includes AAC audio if the source has an audio stream, and reports original bytes, compressed bytes, and a one-decimal size-reduction percentage.
Limitations
- Compression is not guaranteed: invalid or oversized input, unsupported settings, an unavailable processing engine, encoding errors, processing beyond 45 seconds, or missing output can result in failure.
Common errors
- A submission can fail when the quality setting is outside 18 through 40, the preset is not one of the supported choices, or the decoded input exceeds 50 MB. Correct the setting or provide a valid smaller input before submitting again.
FAQ
What size video can I compress?
The input must be nonempty, valid, and within the 50 MB decoded media limit. Processing can also fail if encoding takes longer than 45 seconds or another listed processing condition occurs.
What quality values are supported?
Use a whole-number quality setting from 18 through 40. The default is 28, and the setting is converted to an integer before processing.
What format does the compressed video use?
The output is an MP4 with H.264 video encoding. AAC audio is included when an audio stream is available in the input.
Which encoding presets can I choose?
Available presets range from ultrafast through veryslow, including medium. Preset matching is case-insensitive, and the default is medium.