Video Trimmer
Trim and cut videos with precision. Remove unwanted sections from the beginning, middle or end. Works with MP4, AVI, MOV & more formats.
Supports MP4, MOV, MKV, and more.
About Video Trimmer
How to Use This Tool
Upload your video file or drag and drop into the browser
Supports MP4, MOV, AVI, WebM, MKV • Maximum 2GB file size
Preview video and identify the segment you want to keep
Use frame-by-frame navigation for precise selection
Set start and end points using the timeline slider or time inputs
Timestamp format: HH:MM:SS.mmm (hours:minutes:seconds.milliseconds)
Choose processing mode: Fast (stream copy) or Quality (re-encode)
Fast = instant • Quality = slow but precise frame cuts
Click "Trim Video" and download your edited file
Processing time: 5-30 seconds depending on duration and mode
How Browser-Based Video Trimming Works
Browser video trimming leverages WebAssembly-compiled FFmpeg running entirely client-side. The process involves three distinct technical operations:
1. Stream Copy (Fast Mode) - No Re-encoding
Fast trimming uses stream copying (codec copying) which extracts video/audio packets without decoding and re-encoding:
FFmpeg Command Equivalent:
Process breakdown:
- • -ss 00:01:30: Seek to start timestamp (90 seconds)
- • -to 00:03:45: Stop at end timestamp (225 seconds)
- • -c copy: Copy codec streams without re-encoding (preserves quality)
Limitation: Can only cut at keyframes (I-frames), not arbitrary timestamps. If requesting 1:30.500 but nearest keyframe is at 1:30.800, the output starts at 1:30.800.
⚠️ Keyframe Interval Impact
Most videos have keyframes every 2-10 seconds. Cinema/professional footage may have 1-second intervals (more precise cuts). Screen recordings often have 30-second intervals (less precise cuts).
2. Re-encoding (Quality Mode) - Frame-Accurate Trimming
Precise trimming requires full decode-encode pipeline to cut at exact frames:
FFmpeg Re-encode Command:
Encoding Pipeline Steps:
- 1. Demux: Separate video/audio streams from container format (MP4, MOV)
- 2. Decode: Decompress H.264/H.265 video to raw YUV frames and AAC audio to PCM
- 3. Trim: Discard frames outside specified timestamp range
- 4. Encode: Recompress kept frames using H.264 codec (libx264) with specified quality
- 5. Mux: Package encoded streams back into MP4 container with corrected timestamps
Quality Control Parameters
- →CRF (Constant Rate Factor): 0-51 scale where 0 = lossless, 23 = default balanced quality, 51 = lowest quality. Each +6 CRF halves file size.
- →Preset: Speed/compression tradeoff. "ultrafast" encodes 10x faster but 30% larger files vs. "slow" preset.
- →Bitrate mode: VBR (variable bitrate) adjusts quality per scene. CBR (constant) maintains fixed bitrate for streaming.
3. Timestamp Recalculation and Container Repair
Video containers store Presentation Timestamps (PTS) and Decode Timestamps (DTS) for every frame. Trimming requires timestamp adjustment:
Original file timestamps (90-second trim point):
Frame 2698: PTS = 89.933s, DTS = 89.900s
Frame 2699: PTS = 89.967s, DTS = 89.933s
Frame 2700 (keyframe): PTS = 90.000s, DTS = 89.967s ← CUT HERE
Frame 2701: PTS = 90.033s, DTS = 90.000s
Trimmed file (timestamps reset to zero):
Frame 0 (was 2700): PTS = 0.000s, DTS = 0.000s
Frame 1 (was 2701): PTS = 0.033s, DTS = 0.033s
Frame 2 (was 2702): PTS = 0.067s, DTS = 0.067s
Improper timestamp handling causes A/V desync (audio drift), seeking failures, or incorrect duration metadata. Browser-based FFmpeg automatically performs PTS/DTS normalization to prevent these issues.
Browser Performance Constraints
WebAssembly FFmpeg runs 3-5x slower than native desktop FFmpeg due to JavaScript overhead and single-threaded execution. Realistic processing speeds:
- • Stream copy mode: ~200-500 MB/s (near-instant for most files)
- • Re-encode 1080p H.264: ~15-30 FPS (2-4x realtime)
- • Re-encode 4K H.264: ~5-10 FPS (6-12x realtime)
- • Re-encode HEVC/H.265: ~3-8 FPS (15-20x realtime)
Example: 10-minute 1080p video trimmed with re-encoding takes ~2-5 minutes to process in browser.
Fast Mode vs. Quality Mode Comparison
| Attribute | Fast Mode (Stream Copy) | Quality Mode (Re-encode) |
|---|---|---|
| Processing Speed | 5-10 seconds for 1GB file | 2-5 minutes for 1GB file |
| Cut Precision | ±2-10 seconds (keyframe-limited) | ±0.033 seconds (1 frame at 30fps) |
| Quality Loss | Zero (lossless copy) | Minimal (lossy re-compression) |
| File Size Change | Proportional to trimmed duration | May increase or decrease (depends on CRF) |
| CPU Usage | 5-15% (file I/O only) | 90-100% (full encode) |
| Battery Impact (Mobile) | Negligible | High (rapid drain) |
| Best Use Case | Rough cuts, content removal, quick edits | Precise timing, professional edits, social media |
When Fast Mode Produces Bad Results
Stream copy fails at exact cuts when keyframe intervals are large. Common scenarios:
- →Screen recordings: OBS/Camtasia often use 10-30 second keyframe intervals for smaller files
- →Action cameras (GoPro): High-motion footage benefits from sparse keyframes, creating 5-8 second cut granularity
- →Streaming video downloads: Adaptive bitrate segments may have irregular keyframe placement
Solution: Always use Quality mode when trim precision matters (within 1 second accuracy needed).
Supported Formats and Codecs
| H.264 (AVC) | ✓ Full support |
| H.265 (HEVC) | ✓ Full support |
| VP8/VP9 | ✓ Full support |
| AV1 | ⚠ Slow decode |
| MPEG-4 | ✓ Full support |
| ProRes | ⚠ Large files |
| .mp4 | ✓ Recommended |
| .mov | ✓ Full support |
| .webm | ✓ Full support |
| .mkv | ✓ Full support |
| .avi | ⚠ Legacy format |
| .flv | ⚠ Limited |
Audio Track Handling
Trimming preserves all audio tracks from source videos:
- Multiple audio tracks: Stereo + 5.1 surround both copied to output
- Audio sync: PTS alignment ensures A/V sync maintained across trim points
- Codec support: AAC, MP3, Opus, Vorbis, AC3, DTS all supported
- Sample rate: 44.1kHz, 48kHz, 96kHz preserved without resampling (Fast mode)
Re-encode mode: Audio transcoded to AAC 128kbps stereo by default. Original multichannel layouts simplified to stereo for browser compatibility.
Advanced Trimming Techniques
Pro Tip: Two-Pass Trim for Maximum Quality Retention
When trimming already-compressed video (YouTube downloads, social media exports), avoid quality degradation:
Standard approach (quality loss):
Original (H.264 CRF 23) → Re-encode (H.264 CRF 23) = Generational loss from double compression
Better approach (minimal loss):
- 1. Use Fast mode (stream copy) to get rough cut with ±5 second precision
- 2. Only use Quality mode if Fast mode's keyframe alignment is unacceptable
- 3. When re-encoding is necessary, use CRF 18-20 (higher quality) to offset generational loss
Rule: Each re-encode cycle reduces quality ~10-15%. Stream copy preserves 100% original quality.
Frame-Accurate Trimming Using Timecode Display
For professional edits requiring exact frame cuts (music video beat matching, dialogue cuts):
Calculate exact frame number:
Frame number = (timestamp in seconds) × (frame rate)
Example: Cut at 2:15.500 in 30fps video = (135.5 seconds) × 30 = Frame 4065
Use keyboard shortcuts: Arrow keys for frame-by-frame navigation, Shift+Arrow for 10-frame jumps. Mark in/out points at exact frames visible in preview.
Optimize File Size Without Visible Quality Loss
When re-encoding is required, balance quality vs. file size using CRF values:
| CRF Value | Quality Level | Use Case |
|---|---|---|
| 18-20 | Visually lossless | Archival, professional work |
| 23 | High (default) | General purpose, recommended |
| 28 | Medium | Social media, fast sharing |
| 32+ | Low (visible artifacts) | Extreme compression only |
Handling Variable Frame Rate (VFR) Video
Screen recordings and game captures often use VFR (frame rate varies dynamically). This causes issues:
- •Symptom: Audio drift after trimming, seeking jumps incorrectly
- •Cause: Timestamp assumptions break when frame rate isn't constant
- •Fix: Convert to CFR (constant frame rate) before trimming using re-encode mode with -r flag
Detection: Use MediaInfo or ffprobe to check if "Frame rate mode" is VFR. If yes, always use Quality mode with CFR conversion.
Batch Trim Multiple Sections from One Video
Create multiple clips from a single source video efficiently:
Workflow:
- 1. Load source video once
- 2. Define all trim ranges: (0:30-1:15), (2:45-3:30), (5:00-6:20)
- 3. Queue all operations for single-pass processing
- 4. Generate 3 output files without reloading source
Time saved: 60-70% vs. trimming each segment individually
Preview Quality vs. Output Quality
Browser video preview uses lower resolution for smooth playback. The displayed quality is NOT the output quality. Source resolution is preserved in trimmed files regardless of preview appearance. To verify: check output file properties after download — resolution, bitrate, and codec match source specifications.
Browser Performance and File Size Limits
Memory Constraints
Browser-based processing loads entire video into RAM. Practical limits by device type:
- Desktop (8GB+ RAM): Up to 2GB video files (safe limit), 4GB maximum (may crash)
- Mobile/Tablet (4GB RAM): Up to 500MB video files recommended
- Low-end devices (2GB RAM): 100-200MB maximum to prevent browser crashes
For files exceeding browser limits, use desktop software (DaVinci Resolve, Adobe Premiere, FFmpeg CLI).
| Video Resolution | Fast Mode Speed | Re-encode Speed | Recommended Max Duration |
|---|---|---|---|
| 720p (HD) | 2-5 seconds | 30-60 seconds | 60 minutes |
| 1080p (Full HD) | 3-8 seconds | 1-3 minutes | 30 minutes |
| 1440p (2K) | 5-12 seconds | 3-6 minutes | 15 minutes |
| 4K (UHD) | 8-20 seconds | 8-15 minutes | 5 minutes |
Browser Compatibility
WebAssembly FFmpeg requires modern browser features. Minimum requirements:
- Chrome/Edge: Version 57+ (March 2017 or newer)
- Firefox: Version 52+ (March 2017 or newer)
- Safari: Version 11+ (September 2017 or newer) — iOS 11+ for mobile
- Opera: Version 44+ (March 2017 or newer)
Unsupported: Internet Explorer (all versions), Android WebView in apps (varies by implementation).
When to Trim Videos
Optimal Use Cases
- ✓Social media clips: Extract 15-60 second highlights from longer recordings for Instagram/TikTok
- ✓Meeting recordings: Remove pre-meeting chatter and post-meeting silence from Zoom/Teams recordings
- ✓Tutorial creation: Cut mistakes, pauses, and irrelevant sections from screen recordings
- ✓File size reduction: Remove intro/outro to meet platform upload limits (100MB email, 500MB Discord)
- ✓Privacy protection: Remove sections showing sensitive information before sharing
- ✓Presentation excerpts: Extract specific slides or segments from recorded presentations
Poor Use Cases (Use Full Editor)
- ✗Multi-section edits: Removing 5+ separate segments requires full NLE (non-linear editor)
- ✗Adding effects/transitions: Trimming is cut-only; use DaVinci Resolve for effects
- ✗Audio editing: Volume adjustment, noise reduction, music overlay not supported
- ✗Color grading: No color correction or grading capabilities
- ✗Text/graphics overlay: Cannot add titles, captions, or lower thirds
- ✗Format conversion: Trimming preserves original format; use dedicated converter for format changes
Understanding Quality Loss
Generational Loss in Re-encoding
Each re-encode cycle degrades video quality through lossy compression. Cumulative effect:
Example: YouTube video → Trim → Re-upload cycle
- Generation 0 (original): 100% quality
- Generation 1 (YouTube upload): ~85% quality (YouTube re-encodes all uploads)
- Generation 2 (download + browser trim): ~72% quality (85% × 85%)
- Generation 3 (re-upload): ~61% quality (72% × 85%)
After 3 generations: Visible artifacts (blockiness, color banding, blurring)
Prevent Quality Loss
- ✓Always use Fast mode when keyframe precision is acceptable
- ✓Keep source files (never delete originals after trimming)
- ✓Use highest CRF setting your file size allows (18-23 range)
- ✓Minimize number of re-encode cycles (plan edits carefully)
Causes of Quality Loss
- ✗Using Quality mode on already-compressed video
- ✗High CRF values (28+) for space saving
- ✗Re-encoding downloaded social media videos
- ✗Multiple edit-save-edit cycles on same file
Privacy and Security
✓ Client-Side Processing Advantages
This tool processes videos entirely in your browser using WebAssembly. No data transmission occurs:
- Zero uploads: Video files never leave your device
- No server storage: No copies retained on external servers
- Network independence: Works offline after initial page load
- Privacy compliance: GDPR/CCPA compliant (no data collection possible)
⚠️ Browser Security Considerations
- →Memory residue: Video data remains in browser RAM until tab closed or page refreshed
- →Cache storage: Some browsers cache video data temporarily (clear cache for sensitive content)
- →Download folder: Trimmed videos save to default downloads location (move to secure location if needed)
For maximum security with sensitive videos: Use private/incognito browsing mode, clear cache after processing, delete downloads immediately after transfer.
Processing Limitations Disclaimer
This tool uses WebAssembly-compiled FFmpeg running client-side in your browser. Processing speed is 3-5x slower than native desktop applications due to JavaScript execution overhead and single-threaded WebAssembly constraints. Large files (2GB) may cause browser crashes due to memory exhaustion.
Fast mode (stream copy) accuracy is limited by keyframe intervals in source video — typical precision is ±2-10 seconds. Quality mode provides frame-accurate cuts but requires full re-encoding, causing generational quality loss on already-compressed videos.
For professional workflows requiring multi-track editing, color grading, audio mixing, or batch processing, use desktop software (DaVinci Resolve, Adobe Premiere Pro, Final Cut Pro). For automated server-side trimming at scale, use FFmpeg CLI or cloud video APIs.
Authoritative Sources
- 1. FFmpeg Project. "FFmpeg Documentation - Stream Copy." FFmpeg.org, 2024. https://ffmpeg.org/ffmpeg.html#Stream-copy
- 2. International Telecommunication Union. "ITU-T H.264: Advanced video coding for generic audiovisual services." ITU-T Recommendation, 2021.