Compress Video to Size: Under 10 MB, 25 MB or Any avatar

Compress Video to Size: Under 10 MB, 25 MB or Any

Pricing

from $2.00 / 1,000 output seconds

Go to Apify Store
Compress Video to Size: Under 10 MB, 25 MB or Any

Compress Video to Size: Under 10 MB, 25 MB or Any

Compress a video file to fit under a size limit: Discord 10 MB, WhatsApp 16 MB, email 25 MB or your own number. Two-pass H.264 MP4, checked and redone smaller if needed, with a shareable link. Targets too small for watchable video are refused, free.

Pricing

from $2.00 / 1,000 output seconds

Rating

0.0

(0)

Developer

Quarrywise

Quarrywise

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 hours ago

Last modified

Share

Video Fit-to-Size: give it a video file and a size limit, get back an MP4 that fits under it, or a free row that says why not (for example the smallest size that would work).

Discord, WhatsApp, email and many forms and APIs reject files above a hard limit. This Actor compresses each video to land just under the limit you choose (10 MB, 16 MB, 25 MB, 1 GB or any number), checks the finished file, and redoes it smaller if it came out even one byte over. You get a download link, the exact output size and a within_limit flag you can branch on in Make, n8n, Zapier or your own code. You pay per video and per second of output, at the prices below; videos that cannot meet the limit or fail are free.

Compress video to 10 MB, 16 MB, 25 MB or any size

  • Automation builders (Make, n8n, Zapier, the Apify API) who must attach or post a clip under a fixed size limit, without a manual trip through a web tool.
  • Support, community and CRM teams sending screen recordings and product clips by email or chat.
  • Developers who need one predictable call: video link in, MP4 under N MB out, with the numbers.

What sets it apart:

  • Fits, or you are told why. The limit is a ceiling in decimal megabytes (1 MB = 1,000,000 bytes), so the file fits whether the service counts a megabyte as 1,000,000 or 1,048,576 bytes. output_bytes is never above target_bytes: a file that still comes out over after three tries is not handed out and not charged.
  • Uses the budget instead of guessing. The bitrate is worked out from the video's length, minus the audio and the MP4 index, and encoded in two passes (H.264), which lands within a few percent of the target. Most files need one encode. It never spends more bits than the original had, so a small file is not blown up to fill a large limit.
  • Picks the sharpest picture the budget can carry. It steps down from the original size (up to 1080p) through 720p, 540p, 480p, 360p and 240p until each frame gets enough bits. Frame rates above 30 fps are reduced to 30 by default; with maxFrameRate 60, 60 fps video keeps its frame rate when the budget allows. Portrait phone videos are handled by their short side.
  • Refuses garbage. When even 240p would fall below the watchable floor for the codec, the video is not encoded, nothing is charged, and the row tells you the smallest size limit that works (and how much smaller it could be without audio).
  • Strips metadata. Location, device, date and other tags are removed from every output: the container's metadata always, and the metadata messages embedded in the video stream when a file is copied without re-encoding (re-encoded video starts from a clean stream).

Presets

targetSize limitNotes
discord-1010 MBDiscord's upload limit without Nitro. Used when the input sets neither target nor targetSizeMb.
whatsapp-1616 MBWhatsApp's limit for videos sent as video.
email-2525 MBThe attachment limit of common mail services. Some count the encoded message size, which is about a third larger: if a 25 MB file bounces, use custom with 18 MB.
slack1,000 MBSlack's file upload limit (1 GB).
customtargetSizeMbAny size from 0.5 to 1,000 MB, decimals allowed. From the API you can also leave target out and send only targetSizeMb.

Services change their limits from time to time; custom always does exactly what you set. This Actor is not affiliated with Discord, WhatsApp, Slack or any mail service; their names only describe the size limits.

How to use it

  1. Paste direct links to video files (MP4, MOV, MKV, WebM, AVI and similar) or upload files.
  2. Pick a size limit, or custom and a number.
  3. Run. Each video gets a dataset row with its output_url; the MP4 files are in the run's key-value store.

Options (all optional): maximum resolution (1080p down to 360p), maximum frame rate (24, 30 or 60 fps), audio bitrate (or 0 to remove the audio and give the picture more room), and the video format: H.264 (default, plays everywhere), or AV1 for a sharper picture at the same size in players that support it (see the FAQ).

Input examples

A custom 4 MB limit, at most 720p, no audio (the 12-second 1080p sample is compressed from 6.2 MB):

{
"videoUrls": ["https://quarrywise.com/samples/fit-to-size-test-1080p.mp4"],
"target": "custom",
"targetSizeMb": 4,
"maxResolution": "720",
"audioBitrateKbps": 0
}

Fit a clip under Discord's limit. The sample is 6.2 MB and already under 10 MB, so this run copies it into MP4 without re-encoding for $0.01; a longer clip of your own is compressed:

{
"videoUrls": ["https://quarrywise.com/samples/fit-to-size-test-1080p.mp4"],
"target": "discord-10"
}

From the API, the same with only a size:

{
"videoUrls": ["https://quarrywise.com/samples/fit-to-size-test-1080p.mp4"],
"targetSizeMb": 8
}

From Make, n8n, Zapier or your own code

Start the Actor through the Apify API or the Apify modules for Make, n8n and Zapier with the same JSON, then use output_url and within_limit from the dataset row.

In n8n, use the Apify node's operation "Run an Actor and Get Dataset" and select this Actor By URL (enter exactly https://console.apify.com/actors/lCJp5enIHmRFUtepP/input) or by ID (lCJp5enIHmRFUtepP); the From list picker may not show it while the Actor is hidden from Store search. The Actor's Store page URL does not work in the By URL field. That n8n operation polls until the run ends, so the 300-second limit below applies only to the API's synchronous call.

  • Short clips (up to about a minute): the synchronous "Run Actor and get dataset items" call is fine. It waits at most 300 seconds; after that it answers HTTP 408 while the run carries on (and is still charged for the videos it saves).
  • Longer videos or several videos: start the run asynchronously and continue when it finishes, with a webhook or the "run finished" trigger of your automation tool, then read the dataset.
  • Run timeout: give the run enough time. As a rough guide at the default 4 GB (one CPU core), allow about 2 to 4 minutes per minute of 1080p output, more for 4K phone footage (see Limits). A video that cannot finish before the run's timeout is skipped with a free row before encoding starts, and the run summary in OUTPUT is updated after every video.
  • AI agents (MCP clients): add this Actor as a tool through Apify's MCP server: https://mcp.apify.com?tools=quarrywise/video-compress-to-size The MCP server needs an Apify sign-in or API token.

Output

One dataset row per video, plus the MP4 in the run's default key-value store (record keys start with fit-). The run summary is the OUTPUT record.

FieldMeaning
statuscompressed, copied (already under the limit, copied into MP4 without re-encoding), or why not: target_too_small, over_target, too_long, too_large, not_a_video, refused, download_failed, failed, invalid_input
within_limittrue only when a file under the limit was saved
output_url, output_keyDownload link and record key of the MP4
target, target_mb, target_bytesThe preset (or custom) and the limit in MB and bytes
input_bytes, output_bytes, reduction_percentSizes before and after
duration_seconds, billed_secondsLength (read from the file's packets, not only its header), and the output seconds charged (the last partial second rounded up; 0 when copied)
input_resolution, input_fps, input_codecThe original
resolution, width, height, fps, codecThe output
video_kbps, audio_kbps, passes, attempts, qualityHow it was encoded (quality is good or ok from the bits per pixel)
min_target_mb, noteFor target_too_small: the smallest limit that works, in plain words. Otherwise notes such as an HDR conversion or a codec fallback
error_reason, error_messageWhy a video was not processed (free), for example target-too-small, too-long, http-404, too-slow, not-enough-time, too-complex
source, file_name, input_indexWhere the video came from (links are stored without query strings)

Example row (a real local run of the prefill: the 12-second 1080p test video squeezed into 2 MB):

{
"input_index": 1,
"source": "https://quarrywise.com/samples/fit-to-size-test-1080p.mp4",
"file_name": "fit-to-size-test-1080p.mp4",
"status": "compressed",
"within_limit": true,
"target": "custom",
"target_mb": 2.0,
"target_bytes": 2000000,
"input_bytes": 6184974,
"output_bytes": 1966627,
"reduction_percent": 68.2,
"output_url": "https://api.apify.com/v2/key-value-stores/<store id>/records/fit-001-fit-to-size-test-1080p.mp4",
"output_key": "fit-001-fit-to-size-test-1080p.mp4",
"duration_seconds": 12.0,
"billed_seconds": 12,
"input_resolution": "1920x1080",
"input_fps": 30.0,
"input_codec": "h264",
"resolution": "1280x720",
"width": 1280,
"height": 720,
"fps": 30.0,
"codec": "h264",
"video_kbps": 1158,
"audio_kbps": 128,
"passes": 2,
"attempts": 1,
"quality": "ok",
"min_target_mb": null,
"note": null,
"error_reason": null,
"error_message": null
}

A refused target looks like this (a 30-minute 1080p recording with stereo audio and a 10 MB limit; no file, no charge):

{
"status": "target_too_small",
"within_limit": false,
"duration_seconds": 1800.0,
"min_target_mb": 38.3,
"note": "10 MB is too small for 30:00 of watchable video. Try at least 38.3 MB, or 23 MB without audio. Nothing was encoded and nothing was charged."
}

Pricing

Pay per event. All events are charged only after the MP4 and its row are saved:

EventPriceWhen
Video compressed$0.01Once per video saved under the limit
Output second$0.002Per second of output video ($0.12 a minute). The last partial second counts as a whole one (a 14.5 s clip is 15 seconds); the first tenth of a second past a whole second is not counted
Above-1080p input second$0.002Per second of output, only when the input is larger than 1080p (for example 1440p or 4K phone footage), which takes about twice the compute to decode
ExampleCost
A 15-second clip to 10 MB$0.04
A 45-second clip to 10 MB$0.10
A 1-minute clip to 25 MB$0.13
A 1-minute 4K phone video to 25 MB$0.25
A 3-minute screen recording to 25 MB$0.37
A 10-minute video to 100 MB$1.21
A 30-minute webinar to 1 GB$3.61
A video already under the limit (copied into MP4, no re-encode)$0.01
A target that is too small, a video that ends up over the limit, a failed download or a file that is not a video$0

Plus Apify's standard Actor start event, a fraction of a cent per run. Set a maximum charge per run in Apify Console or the API: the Actor checks the remaining budget before each video and stops cleanly (status limit-reached in the OUTPUT record) instead of downloading or encoding a video it cannot charge for. Use maxDurationMinutes (default 30) to protect your budget from unexpectedly long files.

Limits

  • Input: direct links to video files, uploaded files or key-value store records; up to 2,048 MB per file (less when the run's disk is smaller: more memory gives more disk), up to 120 minutes (30 by default), up to 4K (3840x2160 or 4096x2160); up to 100 videos per run (10 by default).
  • Downloads: a server that sends the file slower than about 200 KB per second (on average, after the first minute) is stopped with a free too-slow row; a download may take at most 30 minutes.
  • Not supported: pages on YouTube, TikTok, Instagram, X, Facebook, Vimeo, Twitch and other video or social platforms (they are web pages, not files, and their terms do not allow downloading), streaming playlists (HLS .m3u8, DASH .mpd), links behind a login, and DRM-protected files. A server that refuses access gets a free error row; the Actor never tries to get around it.
  • Output: MP4 with 8-bit 4:2:0 video (H.264 by default) and AAC audio, at most 1080p and 60 fps; never enlarged. The first video track and the first audio track are kept; subtitles, extra audio tracks, chapters and metadata are dropped. HDR videos (HDR10, HLG, Dolby Vision from phones) are tone-mapped to standard range (BT.709), so they look right in every player.
  • Size limits from 0.5 to 1,000 MB.
  • Memory: 2 to 8 GB per run (4 GB by default). Apify gives one CPU core per 4 GB, and Apify's Free plan allows at most 8 GB per run, so at most 2 cores.
  • Speed: encoding runs on the CPU. On one desktop core, 1080p output took about 0.9 times the video's length from a 1080p H.264 source, about 1.7 to 2 times from 4K HEVC phone footage, and 720p output about 0.4 times (both passes). Cloud cores can be up to twice as slow; more memory gives more cores. Each encode pass has a time limit based on the expected time; a video that hits it is free.
  • Free work per run: after 30 minutes spent on videos that could not be saved (failed downloads, time-outs, over-limit results), a run starts no further videos and gives each remaining one a free free-work-limit row.

Privacy

  • Videos are processed only for your run: downloaded to the run's temporary disk, encoded, and deleted from that disk when the video is done. The compressed files and rows are stored only in the run's default key-value store and dataset, which belong to your Apify account and are deleted automatically after your plan's data retention period (or when you delete them).
  • output_url is a shareable link: anyone who has it can download the file until the store expires. Do not post it publicly if the video is private.
  • Nothing from your videos is logged: logs show the input number, sizes, resolution and timing, never file names, links or content. Query strings (where signed links usually carry their token) are removed from the dataset, the logs and the run summary. A link that carries a token in its path is stored as given, and the run's INPUT record keeps your links exactly as you entered them.
  • Location, device and other metadata are removed from every output file (see above).
  • Only process videos you have the right to process. Quarrywise does not look at, keep or reuse your videos.

Open-source software

Video is encoded by FFmpeg from the Debian distribution package, run as a separate program inside the Actor's container. That FFmpeg build is GPL-licensed, as is the x264 (H.264) encoder it uses; SVT-AV1 (AV1) is BSD-licensed. The Actor's own code is not linked with them, and the container image is not distributed.

FAQ

Why is my file a little under the limit, not exactly at it? The encoder aims about 3% under the limit (5% for AV1) so the file never goes over; the second pass lands close to that aim.

Why did it lower the resolution? At small sizes, fewer pixels with enough bits each look much better than full resolution with too few. Set maxResolution if you need a specific size, or a larger limit for more detail.

What happens if the limit is too small? Nothing is encoded or charged. The row says target_too_small and gives min_target_mb, the smallest limit that gives watchable video, plus the smaller figure without audio. If the file already fits as it is and can be copied, it is copied instead.

My video is already small. Will it get bigger? If it is already under the limit, is H.264 (or the format you chose) in 8-bit standard range, within your maximum resolution and frame rate, and has AAC or MP3 audio, it is copied into MP4 unchanged apart from the removed metadata, for the per-video price only. Otherwise (for example an HEVC iPhone clip, a 10-bit or HDR video, or a WebM with VP9 and Opus audio) it is re-encoded to an MP4 that plays everywhere, which costs the per-second price. The re-encode never uses more video bits than the original had (at most 30% more, to make up for converting a newer codec to H.264), so the new file can be somewhat larger than the original, but never fills the limit for nothing. The row's note says so when the result is not smaller.

Can I compress a YouTube or TikTok video? No. Use a direct link to a video file you have the right to process, or upload it.

Which format should I choose? H.264 for anything you share: it plays in every app, browser, phone and TV. AV1 gives a sharper picture at the same size (or the same picture in a smaller file), but many messaging apps, older phones, TVs and editing programs cannot play it, and Apple devices play it only when they have an AV1 hardware decoder (recent iPhone Pro and Mac models). Check that your destination plays AV1 before you choose it. AV1 is encoded in one pass, so it is often redone once to land under the limit; it is still faster than H.264's two passes and costs the same. If the AV1 encoder is not available, the video is encoded as H.264 and the row's note says so.

Can I get H.265 (HEVC)? Not at the moment. Videos in HEVC (for example from iPhones) are accepted as input; the output is H.264 or AV1.

Can I use it from Make, n8n or Zapier? Yes: see "From Make, n8n, Zapier or your own code" above for which call to use and how long to let the run take.

Provider

Provided by Quarrywise, a trade name of Picazzo Research & Development, Zinkstraat 24, Box C4687, 4823 AD Breda, the Netherlands. KvK 42060545, VAT NL005464235B85. Contact: hello@quarrywise.com or the Issues tab.