Any docs on when Builder.io chooses to compress video assets

Is there any info on how / when Builder.io compresses videos?

We have one MP4 video at ~9.6 MB that was uploaded fine. We wanted to swap that video out with a new MP4 video which is also ~9.6 MB. It seems to have identical specs—30 FPS, H.264 (Main profile), ~7,000 kbps, ~2880 x 1080.

If I upload it and then immediately download it from builder. The asset appears unchanged. But, a few moments later after a refresh, the same asset is suddenly now 700 KB in size (less than 1/10 of the previous size), it’s now at 720p, and it looks like crap.

Is there any info on at what point Builder starts compressing videos? I didn’t see any options in Builder to turn it off. I’m aware of the optimized=true URL param, but it has no effect on videos which seem to have their asset permanently altered after upload.

Builder public api key
258ecfc7081e40789f548235b67f0521

What are you trying to accomplish
Upload a video asset and not have it compressed like crazy.

Code stack you are integrating Builder with
NextJS

Hello @chris-hayes,

Great question, and what you’re seeing actually lines up with how video processing currently works in Builder.

Video compression does not happen immediately on upload. There’s a short delay between when the file is uploaded and when the compression job runs. During that window, if you download the asset, you’ll get the original file. After a few minutes, once processing completes, the asset is replaced with the compressed version, which is why you’re seeing the sudden drop in size and resolution.

At the moment, this compression step is automatic and there isn’t a setting in Builder to disable it. The optimized=true parameter also doesn’t affect videos in the same way it does for images, since videos are processed and stored as compressed assets rather than dynamically transformed at request time.

If you want to trigger compression manually for a specific asset, you can use the following request (replace with your actual values and a valid private API key):

curl --location 'https://cdn.builder.io/api/v1/compress-media/assets%2F<SPACE_ID>%2F<ASSET_ID>?apiKey=<SPACE_ID>&assetDbId=<ASSET_DB_ID>&updateAssetFileUrl=true' \
--header 'Authorization: <BEARER-TOKEN>'

A couple of notes on the parameters:

  • apiKey is your Builder public API key
  • assetDbId is the internal ID of the asset (you can retrieve this via the Query Assets API)
  • updateAssetFileUrl=true ensures the asset URL is updated to point to the compressed version once processing is complete

You can also access the compressed version directly via the /compressed path once it’s available.

That said, the behavior you’re describing where the compressed output drops significantly in quality is definitely not ideal. If you’re consistently seeing aggressive downscaling like this, feel free to share an example asset URL and we can take a closer look.

Hope this helps clarify things :+1: