Trim HEVC — Free Online Tool
Trim HEVC/H.265 video files with a stream copy — no re-encoding, no quality loss. This tool cuts your H.265 footage to a precise time range at full speed, preserving the original libx265-encoded bitstream exactly as-is.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your HEVC file here
or click to browse
Free — no uploads, no signups. Your files never leave your browser.
Settings
Note: Browser-based encoding uses approximate quality targets. For precise CRF compression, copy the FFmpeg command above and run it on your desktop.
Estimated output:
Conversion Complete!
DownloadHow It Works
HEVC trimming using '-c copy' is a remux operation: FFmpeg seeks to the requested start point and copies the raw H.265 NAL unit stream into the output file without decoding or re-encoding a single frame. Because H.265 uses long-GOP compression with keyframes (IDR frames) that may not land exactly on your chosen timestamp, the actual cut point will snap to the nearest preceding keyframe. This means the trim is nearly instantaneous and lossless, but sub-second precision at arbitrary points is only possible when re-encoding. The output is a raw .hevc bitstream file containing the same libx265-encoded video data, trimmed to approximately the requested range.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary — in this browser-based tool, this is FFmpeg.wasm running entirely in your browser via WebAssembly; when run locally, this calls your desktop FFmpeg installation. |
-i input.hevc
|
Specifies the input raw HEVC elementary stream file. FFmpeg detects the H.265 bitstream directly without a container, reading the NAL unit structure to determine frame boundaries and timing. |
-ss 00:00:00
|
Sets the trim start time to the beginning of the file. Placed after '-i', this performs a slower but more accurate output-side seek, ensuring FFmpeg reads from the start and finds the correct keyframe boundary for the cut rather than doing a fast input-side seek that may be imprecise on raw bitstreams. |
-to 00:00:10
|
Specifies the absolute end timestamp for the trim, stopping the output at 10 seconds. This is an output-side option that works in tandem with '-ss' to define the clip window; change this value to any HH:MM:SS timestamp to control where your trimmed HEVC clip ends. |
-c copy
|
Instructs FFmpeg to copy all streams — in this case the H.265 video stream — without decoding or re-encoding. The libx265-compressed NAL units are passed through byte-for-byte, making the operation nearly instant and completely lossless regardless of the original CRF or encoding settings. |
output.hevc
|
The output filename for the trimmed raw HEVC elementary stream. Using the .hevc extension signals that this is a containerless H.265 bitstream, matching the input format and ensuring downstream tools that expect a raw elementary stream can process it without unwrapping a container. |
Common Use Cases
- Extract a specific scene from a 4K HDR H.265 camera file (e.g., from a Sony or Panasonic mirrorless) for quick review without transcoding and degrading the original quality
- Split a long H.265 screen recording or gameplay capture into shorter clips for upload, keeping file sizes small thanks to H.265's high compression efficiency
- Isolate a segment of an H.265 encode for quality analysis — for example, trimming a problematic section to inspect blocking artifacts at a given CRF setting
- Prepare a short H.265 sample clip from a larger file to test device compatibility (e.g., smart TVs, media players) before committing to a full conversion workflow
- Remove unwanted head or tail footage from a drone video file encoded in HEVC before importing into a video editor, reducing project timeline clutter
- Create a keyframe-accurate rough cut from raw H.265 footage to share with a client for approval before performing a full re-encode with corrected trim points
Frequently Asked Questions
No. The '-c copy' flag instructs FFmpeg to copy the H.265 bitstream byte-for-byte without decoding or re-encoding it. The CRF value, resolution, chroma subsampling, HDR metadata, and every other encoding parameter from the original libx265 encode are preserved intact. The only caveat is that the cut snaps to the nearest keyframe, which may shift the start point by up to a few seconds depending on how frequently the source was encoded with IDR frames.
H.265 video uses inter-frame compression where most frames (P-frames and B-frames) depend on a preceding keyframe (IDR frame) to decode. When copying without re-encoding, FFmpeg can only start the output at a keyframe boundary. If your requested start time falls between two keyframes, FFmpeg snaps backward to the nearest one. To get a frame-accurate cut at an arbitrary point, you would need to re-encode by removing '-c copy' and specifying a CRF value, which will decode and re-compress the video around the cut.
Raw .hevc files contain only the H.265 video elementary stream with no container wrapper, timestamps, or audio tracks. Most media players (VLC, mpv) can open them, but compatibility with video editors and web browsers is limited. If you need broader compatibility or want to include an audio track, consider wrapping the trimmed stream in an MP4 or MKV container instead. This tool outputs the same raw bitstream format as the input, which is ideal for pipeline use but may need remuxing for consumer playback.
Modify the '-ss' value for the start time and the '-to' value for the end time. Both accept the format HH:MM:SS or HH:MM:SS.mmm for sub-second precision (e.g., '-ss 00:01:30.500 -to 00:03:45'). You can also use '-t' instead of '-to' if you prefer to specify a duration rather than an absolute end timestamp — for example, '-t 00:02:15' would trim 2 minutes and 15 seconds starting from the '-ss' point.
The command as shown processes a single file. For batch trimming, you can wrap it in a shell loop. On Linux/macOS: 'for f in *.hevc; do ffmpeg -i "$f" -ss 00:00:00 -to 00:00:10 -c copy "trimmed_$f"; done'. On Windows PowerShell: 'Get-ChildItem *.hevc | ForEach-Object { ffmpeg -i $_.Name -ss 00:00:00 -to 00:00:10 -c copy "trimmed_$($_.Name)" }'. All instances will apply the same trim range, so this is best suited for clips that share a consistent structure.
Yes, when using '-c copy', all SEI (Supplemental Enhancement Information) NAL units carrying HDR10 mastering display metadata and content light level information are copied verbatim into the output. However, Dolby Vision RPU data embedded in the bitstream is also copied as-is, though the raw .hevc container may not signal Dolby Vision profile information in the same way a properly muxed MP4 or HEVC container would. For full HDR metadata fidelity in a deliverable file, remuxing into an MP4 container with appropriate signaling is recommended.
Technical Notes
This tool operates on raw HEVC elementary stream (.hevc) files encoded with libx265. Because the output format is identical to the input — a containerless H.265 bitstream — no codec negotiation or transcoding occurs. The '-c copy' stream copy mode means the libx265 encoding parameters (CRF, preset, x265-params, color space, bit depth) are all inherited from the original encode; the trimmer has no influence over them. One important limitation of trimming raw .hevc files versus container-wrapped files (MP4, MKV) is that without a container's timestamp track, some players may struggle with accurate seeking in the trimmed output. The special flag '-x265-params log-level=error' suppresses verbose x265 encoder diagnostics in the terminal, keeping output clean — though with '-c copy' active, libx265 is not actually invoked for encoding, so this flag has no effect on this specific command. Files processed here stay entirely in your browser via FFmpeg.wasm; nothing is sent to a server. For files over 1GB, copy the displayed FFmpeg command and run it locally where memory and processing constraints are much lower.