Guide · Video
Trim, crop and caption a video in the browser
By NREX Group · Published · Sources last checked: · 9 min read
Drafted with AI assistance and checked against the sources listed at the end.

These tools cannot cut a video file the way a desktop editor does. They open your clip in a hidden player, play it at normal speed, draw every frame on a canvas and record the canvas again. Trimming, cropping, rotating, captioning and merging all work like that, and four things follow. The job takes about as long as the part you keep. The result is a new encode, not a copy. The frame rate is capped at 30 per second. And the tab has to stay in front, because most browsers pause the drawing callbacks of background tabs.[2, 3]
This guide uses that fact to plan a job: what to do first, what each step changes, and what to check before the original is deleted. The numbers come from generated 4-second clips run through the site’s own tool code in three browser engines, with scripts and raw output saved. Generated clips are not camera footage, so read each table as a pattern.
What the tools actually do
For each frame, the tool calls drawImage on a canvas. For a crop it uses the form with a source rectangle, so the pixels outside the box are not drawn.[4] A canvas stream is then fed to MediaRecorder. Of these tools only the compressor sets a video bitrate, so elsewhere the browser’s default applies: MDN gives 2.5 Mbps or 10 Mbps depending on the browser.[1] That is why a small file can come out larger and why quality can drop a little on every pass.
Two practical limits come with it. The frame rate is requested at 30 per second at most, so a 60 fps phone clip loses frames. And the container is chosen by the browser: MP4 with H.264 where it can record that, WebM where it cannot. Chromium 153 and the WebKit build wrote MP4 in our runs; Firefox 155 wrote WebM only. The result card names the type, and the next guide, MP4, MOV and WebM, covers what that means for where the file will play.
Trimming: how close is the cut
Trim Video takes a start and an end in steps of 0.1 second and will not accept less than 0.2 seconds. It jumps to the start, so the length of the original does not matter, only the part you keep. We asked for 1.0 to 3.0 seconds from the 4-second clip:
| Engine | File written | Length read back | Bytes | Stopped at (source s) |
|---|---|---|---|---|
| Chromium 153 | MP4 (H.264) | 2.11 s | 321,196 | 3.003 |
| Firefox 155.0 | WebM (VP8) | 2.10 s | 149,220 | 3.019 |
| WebKit 26.6 | MP4 (H.264) | 2.34 s | 310,151 | 3.016 |
The end was checked once per screen refresh, so it overshot by 0.003 to 0.019 seconds. The files were 0.10 to 0.34 seconds longer than the range because the recorder runs a little beyond the drawing loop. In Chromium and Firefox the first frame of the output showed the yellow bar at 25% of its full length, the position for 1.0 s of 4.0 s, so the cut started where it was asked to.
One more run is worth knowing about. In a Firefox run where the trim came after a caption pass, drawing stopped at 3.24 seconds for a requested 3.0. A file that has been recorded once can be less precise to cut, so do the cut on the original when you can.
Cropping: the box is in source pixels
Crop Video draws only the box, at the box’s own size, with no scaling or padding. So the output size is the box size, and a ratio such as 9:16 only fixes the shape. The page starts with a square box and keeps its width where the new height still fits, otherwise its height, when another ratio is picked. This is the arithmetic the tool’s box code gave, rounded to whole pixels:
| Source | 1:1 | 9:16 | 16:9 |
|---|---|---|---|
| 640 × 360 | 360 × 360 | 203 × 360 | 360 × 203 |
| 1920 × 1080 | 1080 × 1080 | 608 × 1080 | 1080 × 608 |
| 1080 × 1920 | 864 × 864 | 864 × 1536 | 864 × 486 |
| 3840 × 2160 | 2160 × 2160 | 1215 × 2160 | 2160 × 1215 |
We recorded the 640 × 360 row. The 1:1 crop came out 360 × 360 and the 9:16 crop 203 × 360 in all three engines, so the sizes follow the code rather than the browser. Files were 521,993 and 277,555 bytes in Chromium (MP4), 322,701 and 165,315 in Firefox (WebM), and 349,698 and 173,620 in WebKit (MP4). A platform that wants 1080 × 1920 has to enlarge the 608 × 1080 result somewhere else.
Rotating: fix a sideways clip first
Rotate Video draws the turn into the pixels, so the new file is upright in any player. A quarter turn swaps width and height: our 640 × 360 clip came out 360 × 640 in every engine. To check the direction, the red square was found in a frame of each output. It moved from the top-left corner of the source to the top-right corner of the rotated frame (x 333 to 334, y 25 in a 360-pixel-wide frame) after Rotate 90 CW.
Order matters when a crop is planned. The crop box is measured in the pixels of the file you load, so a clip that was filmed sideways is cropped as a sideways picture unless it is rotated first.
Captions: burned in, one cue at a time
Burn Subtitles into Video reads an SRT or VTT file, draws the active cue on every frame in a black box at 60% opacity, and records the result. Only one cue is drawn at a time, even though WebVTT itself lets cues overlap.[6] We used a file with two cues covering 0.4 to 1.6 s and 2.0 to 3.6 s of a 3.97-second clip:
| Engine | Frames drawn | With a caption | White px at 1.0 s | White px at 1.8 s | White px at 2.8 s |
|---|---|---|---|---|---|
| Chromium 153 | 238 | 165 | 1,484 | 0 | 1,730 |
| Firefox 155.0 | 482 | 334 | 1,514 | 0 | 1,749 |
| WebKit 26.6 | not run | not run | not run | not run | not run |
Frame counts differ because Firefox drew about 120 frames per second and Chromium about 60, but the share is the same: 69% of frames carried a caption in both, against about 70% of the clip’s length under cues. At 1.8 seconds, between the cues, there were no caption pixels at all, and the band’s average brightness dropped where the black box sat (121 against 144 at 1.0 s in Chromium). WebKit has no row: our test setup could not start the unmuted playback this loop needs, and the WebKit build refused it with a NotAllowedError, so we did not measure the tool there.
Size is in video pixels, not screen pixels. The default of 32 px is 8.9% of the height of a 360-pixel-high clip and 3.0% of a 1080-pixel-high one, so the same setting looks small on a large video. The slider runs from 16 to 80 px. For a 4K clip the maximum is 3.7% of the height.
Order of operations, measured
Every step records in real time over the length it is given, so the order can nearly double the work. Two orders ran on the same clip and ended in the same result: the 1.0 to 3.0 second range, cropped to 360 × 360.
| Engine | Trim, then crop | Crop, then trim |
|---|---|---|
| Chromium 153 | 4.3 s, 251,381 B, 2.17 s long | 6.1 s, 229,831 B, 2.07 s long |
| Firefox 155.0 | 4.1 s, 96,789 B, 2.03 s long | 6.1 s, 145,039 B, 2.04 s long |
| WebKit 26.6 | 4.9 s, 153,168 B, 2.49 s long | 7.3 s, 142,477 B, 3.07 s long |
Trimming first meant two passes of about 2 seconds. Trimming last meant a pass of 4 seconds and then one of 2. With a caption pass added, three passes took 6.4 seconds in Chromium when the trim came first and 10.2 seconds when it came last, and 6.2 against 10.4 seconds in Firefox. The files differ in size because each pass is lossy and the encoder’s choices differ from run to run.
The length column holds a warning. In WebKit, the trim after a crop read back 3.07 seconds for a 2-second range, against 2.35 seconds when the trim was done on the original. Cutting the original first avoids stacking that drift, and it is one more reason to check the result card before you delete anything.
Merging and compressing
Merge Video Clips sizes the output to the first clip and fits every later clip inside it with black bars. In our test a 4-second 640 × 360 clip followed by a 3-second 360 × 640 clip gave a 640 × 360 file of about 7 seconds. In a frame from the second half, the left edge was black and the portrait clip sat in a strip about 203 pixels wide, which is the fit rule at work: 360 pixels of height scaled by 0.5625. The merge took 7.0 seconds of recording in Chromium and 7.7 seconds in Firefox.
Video Compressor offers Low (full size, about 1.5 Mbps), Standard (75% of the width and height, about 1 Mbps) and High (50%, about 500 kbps). Those are targets for the recorder, not promises: 4 seconds at 1.5, 1 and 0.5 Mbps comes to about 750, 500 and 250 kilobytes. We ran the three levels on a silent 4-second clip of 544,311 bytes:
| Level | Frame size | Chromium 153 | Firefox 155.0 | WebKit 26.6 |
|---|---|---|---|---|
| Low | 640 × 360 | 348,856 (64%) | 481,284 (88%) | 586,639 (108%) |
| Standard | 480 × 270 | 232,836 (43%) | 350,419 (64%) | 373,600 (69%) |
| High | 320 × 180 | 120,078 (22%) | 200,909 (37%) | 209,056 (38%) |
Every file came in under that figure, and every file opened at the length of the source, give or take 0.06 seconds. The Low level in WebKit was bigger than the source, which is the case the tool page warns about: a clip whose own bitrate is already low can grow when it is recorded again. A clip with sound is a separate test; we kept sound out of this one on purpose, and the sound section below says what to check.
Sound, and what to check before deleting the original
The tools do not all attach sound the same way. In our runs the trim, crop and rotate loops produced a file with an audio track only in Chromium 153, where the audio was AAC inside MP4. The burn-subtitles and merge loops route the sound through the Web Audio API instead, and they produced an audio stream in Firefox 155.0 too (Opus in WebM). In Chromium those two wrote Opus inside the MP4, while the other loops wrote AAC. We did not test whether other players open an MP4 with Opus sound, but some players and editors expect AAC, and a pass through Video Converter asks for AAC where the browser allows it.
A short checklist:
- Play the preview from start to end, with sound if it matters.
- Compare the length and pixel size on the result card with what you expected.
- Check the file size: a result of a few kilobytes is not a video.
- Keep the original until the new file has been opened somewhere else.
A file written as WebM can report no length until a player seeks to its end, which MDN describes as Infinity for media without a known duration.[5] That is normal for recorded files and is handled by the tools; it only matters if another program refuses to show a length.
Questions
Is a trim from these tools frame-accurate?
Not guaranteed. The tool jumps to the start time, plays, and stops at the first screen refresh at or after the end time. In our test the stop landed 0.003 to 0.02 seconds past the requested end on first-generation clips, and 0.24 seconds past it in one Firefox run on a file that had already been recorded once. Treat the cut as accurate to a fraction of a second.[3]
Why is the trimmed file a little longer than the range I chose?
The recorder starts before the first frame is drawn and stops after the last one. A 2-second range read back as 2.10 to 2.34 seconds in our three engines, and a full 3.97-second clip read back as 4.01 to 4.29 seconds after a crop.
Which order should I use for trim, crop, rotate and captions?
Shortening comes first because every later step is recorded in real time over whatever length is left. Rotate before you crop if you mean to crop the upright picture, because the crop box is measured in the pixels of the file you load. Captions come last so that later steps do not re-encode the text. Compression, if you need it, is the final pass.
Can the captions be switched off afterwards?
No. They are drawn into the picture, one cue at a time, on a semi-transparent black box. Keep the subtitle file if a platform can show captions from the file itself.
What if my VTT file has two cues at the same time?
WebVTT allows overlapping cues, but the burn-in tool draws one caption per frame, so only one of them shows. Give the cues separate time ranges first.[6]
Does every step keep the sound?
Not in every browser. In our test only Chromium 153 attached the sound in the trim, crop and rotate loops. The burn-subtitles and merge loops also produced an audio stream in Firefox 155. We checked for an audio track and codec names in the file and did not listen, so play the result before you delete the original.
Sources
Every link below was opened and checked on November 15, 2026. The timings, sizes, crop boxes and caption counts were measured for this guide with the site’s own code.
- MDN, MediaRecorder() constructor. The note that, when bits-per-second values are not set, the default for video is 2.5 Mbps or 10 Mbps depending on the browser. Accessed November 15, 2026.
- MDN, HTMLCanvasElement.captureStream(). captureStream() returns a stream with a real-time video capture of the canvas, with an optional frame rate parameter. Accessed November 15, 2026.
- MDN, Window.requestAnimationFrame(). requestAnimationFrame() calls are paused in most browsers when running in background tabs. Accessed November 15, 2026.
- MDN, CanvasRenderingContext2D.drawImage(). The nine-argument form that takes a source rectangle and a destination rectangle, which is how a crop is drawn. Accessed November 15, 2026.
- MDN, HTMLMediaElement.duration. A media element without a known duration, such as live media, reports Infinity. Accessed November 15, 2026.
- W3C, WebVTT: The Web Video Text Tracks Format. WebVTT cues can overlap, cue text can carry spans such as bold and italics, and a cue timestamp may leave out the hours when they are zero. Accessed November 15, 2026.