Trim TS — Free Online Tool
Trim a TS (MPEG-2 Transport Stream) file to a precise start and end point, cutting out exactly the segment you need. Because the output stays in the same TS container with the same codecs, the trim is performed as a stream copy — no re-encoding — so the operation is nearly instant and lossless.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your TS 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
Trimming a TS file to TS uses FFmpeg's stream copy mode (-c copy), which means the video and audio bitstreams — whether H.264, H.265, AAC, AC3, or any other codec present in the transport stream — are extracted and written directly into the new output file without any decoding or re-encoding. FFmpeg seeks to the specified start point (-ss 00:00:00) and stops writing at the specified end point (-to 00:00:10). Because TS is a packetized streaming format with fixed-size 188-byte packets designed for broadcast resilience, the cut points are aligned to the nearest keyframe in the video stream. This means the actual trim may start a fraction of a second before the requested in-point to ensure the output begins on a clean keyframe, which is standard and expected behavior for stream-copy trimming of any compressed video format. Any embedded subtitles and multiple audio tracks present in the source TS are preserved in the output without modification.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg command-line tool. In the browser version this runs via FFmpeg.wasm compiled to WebAssembly, executing the same logic as the desktop binary without any file leaving your machine. |
-i input.ts
|
Specifies the input MPEG-2 Transport Stream file. FFmpeg reads the TS packet structure, identifies all elementary streams (video PIDs, audio PIDs, subtitle PIDs) via the Program Map Table, and prepares them for copying. |
-ss 00:00:00
|
Sets the start time of the trim to 0 hours, 0 minutes, 0 seconds. Placed before -i, this uses fast keyframe-level seeking within the TS stream, jumping efficiently to the nearest keyframe at or before the specified timestamp without decoding every preceding packet. |
-to 00:00:10
|
Sets the end point of the trim at 10 seconds from the start of the original file. FFmpeg stops writing packets to the output TS once this timestamp is reached. Change this value to any HH:MM:SS timestamp to capture a different segment length. |
-c copy
|
Instructs FFmpeg to copy all streams — video (H.264, H.265, or whatever codec is in the source TS), audio (AAC, AC3, MP3, etc.), and subtitles — directly without decoding or re-encoding. This makes the trim nearly instantaneous and guarantees zero quality loss, since the compressed bitstream is written byte-for-byte into the new TS container. |
output.ts
|
Specifies the output filename. The .ts extension tells FFmpeg to write the result as an MPEG-2 Transport Stream, maintaining full compatibility with broadcast systems, IPTV servers, HLS pipelines, and media players that support the TS container. |
Common Use Cases
- Extract a specific news segment or sports highlight from a recorded broadcast TS file captured via a DVB or ATSC tuner card, without touching the original H.264 or H.265 video quality.
- Clip a precise time range from an HLS-compatible TS recording for re-streaming or archiving, preserving the original AAC or AC3 audio tracks and embedded DVB subtitles.
- Remove unwanted ad breaks or black frames from the beginning or end of a broadcast recording stored as a transport stream, keeping the remaining content bitstream identical to the source.
- Extract a short test clip from a long overnight broadcast recording to verify codec settings, audio track layout, or subtitle streams before processing the full file.
- Prepare a short TS segment for upload to a broadcast playout system or IPTV server that requires content in native transport stream format with intact PTS/DTS timestamps.
- Isolate a specific scene from a multi-hour live stream archive recorded as TS to share with a production team, delivering an exact segment without quality loss or format conversion overhead.
Frequently Asked Questions
No. Because -c copy is used, FFmpeg reads the existing compressed video and audio packets from the transport stream and writes them directly to the output without decoding or re-encoding. The H.264, H.265, AAC, AC3, or other codec data is byte-for-byte identical to the source. Quality loss only occurs when a file is decoded and re-encoded, which this trim operation explicitly avoids.
This is expected behavior when using stream copy mode. TS video streams — like all compressed video — can only start playback at a keyframe (I-frame). When you specify a start time, FFmpeg snaps back to the nearest preceding keyframe so the output file is decodable from its very first packet. The difference is typically less than a second and depends on the keyframe interval of the original broadcast encoding. If you need frame-accurate cuts, the file would need to be re-encoded, which would involve significant processing time and some quality loss.
Yes. MPEG-2 Transport Streams commonly carry multiple audio tracks (for example, stereo and surround AC3, or multi-language streams) as well as DVB or SCTE subtitles, all multiplexed as separate PID streams. The -c copy flag copies all mapped streams, so every audio track and subtitle stream present in the source TS will appear in the trimmed output TS. No track selection or remapping is needed unless you specifically want to drop certain tracks.
Modify the values after -ss (start time) and -to (end time) in the command. Times are in HH:MM:SS format, but you can also use plain seconds (e.g., -ss 45 -to 120 to trim from 0:45 to 2:00). Alternatively, replace -to with -t to specify a duration instead of an end timestamp — for example, -ss 00:01:30 -t 00:00:45 would extract 45 seconds starting at the 1:30 mark. Placing -ss before -i (as shown) uses fast keyframe-level seeking, which is recommended for stream copy trimming.
Yes. On Linux or macOS you can use a shell loop: for f in *.ts; do ffmpeg -i "$f" -ss 00:00:00 -to 00:00:10 -c copy "trimmed_$f"; done. On Windows Command Prompt, use: for %f in (*.ts) do ffmpeg -i "%f" -ss 00:00:00 -to 00:00:10 -c copy "trimmed_%f". Because -c copy is used, each file processes very quickly — typically in a few seconds regardless of the original file's duration.
In most cases, yes. The output is a standard MPEG-2 Transport Stream with the same codec streams and packet structure as the source, so it should be accepted by any system that supports the original file. However, some strict broadcast playout systems validate PTS/DTS timestamps, and a trimmed segment will have timestamps that begin mid-stream rather than at zero. If your playout system requires timestamps to start at zero, you may need to pass the output through a tool that resets the PTS, or use FFmpeg's -output_ts_offset flag to adjust timing.
Technical Notes
MPEG-2 Transport Streams are designed specifically for error-resilient transmission, built from a sequence of fixed-size 188-byte packets each carrying a Packet Identifier (PID) that links it to a specific elementary stream — video, audio, subtitle, or program map. When FFmpeg trims a TS file using stream copy, it preserves this packetized structure in the output, keeping the original codec configuration, profile, level, and bitrate entirely intact. Because TS does not use a traditional index structure like MP4's moov atom, seeking is done by scanning for PCR (Program Clock Reference) values, which is why -ss placed before -i is especially effective for fast seeking in large broadcast recordings. One important limitation: TS does not support chapter markers, so any chapter information present in the conceptual edit will not be embedded. Streams that use AC3 (Dolby Digital) — common in North American broadcast TS files — are fully preserved by stream copy, as AC3 is a native and well-supported audio codec in the TS container. FLAC audio in TS is preserved losslessly. If the source TS originated from a live stream or DVR recording with discontinuities or null packets, FFmpeg may log warnings during the copy operation; these are generally harmless and the output will still be valid. The default video codec for re-encoding (if you were to remove -c copy) would be libx264 at CRF 23, and the default audio codec would be AAC at 128k, but for same-format trimming, re-encoding is unnecessary and should be avoided.