Lossless cutting of MPEG TS files in Windows

5

2

I have several HD video files in transport stream (.ts) format, recorded with my satellite receiver.

I want to cut them, as in simply remove a few minutes from the beginning, the end and sometimes a few minutes in the middle of it (remove early start of recordings, late ends and, for some seldom files, the ads).

What is a good, ideally but not necessarily free, software with a GUI to do this? Best would be something where you could select points on a timeline and simply cut the elements out.

As a resulting file, just the same .ts format would be great, but I could also live with putting the video contents into another container, as long as the video is NOT re-encoded / transcoded.

The files have additional audio streams and subtitles. These should be retained in the process.

My OS is Windows.

Sebastian P.R. Gingter

Posted 2012-01-27T18:20:47.893

Reputation: 237

Question was closed 2014-06-10T19:04:27.187

Would be great if you mentioned your OS. And, what have you already tried? I believe most NLEs should work, only importing the TS format might be a bit troublesome. You might need to change the container before. Can you run MediaInfo to check what codec is used inside?

– slhck – 2012-01-27T18:23:23.477

Oh, and you don't want to re-encode anything in this process? – slhck – 2012-01-27T18:25:50.603

OS is Windows (added above), and if possible I want to avoid re-encoding, because I don't want to loose quality. - What does NLE stand for? – Sebastian P.R. Gingter – 2012-01-27T18:28:45.603

I'm inclined to say this is an almost exact duplicate of What is the best software to split and join avi files? — you'd only have to find out how to import the transport stream. NLE is a non-linear editor.

– slhck – 2012-01-27T18:30:57.647

Answers

4

Avidemux maybe the simplest solution for you. It can copy/remux from stream to stream without re-encoding. Just remember that you select Copy in the video output instead of any codecs, and the start marker must be at an I-frame

The frame type is displayed beside clip time, as you can see Frame:I(02) in the below screenshot (although the format may be changed in later versions, for example Frame type: I-FRM (00) in 2.7.1)

keyframe avidemux

You can also quickly select the I-frame by select the next/prev key frame buttons (shortcut: Up/Down)

The reason is that a video file is split into group-of-pictures (GOP) that are encoded independent of each other, and contain... pictures/frames in the stream, of course. Each GOP starts with an I-frame (A.K.A key frame) which is a full image without any interpolation, followed by B or P frames. So when you start with an I-frame, the whole GOP can be copied to the output file without re-encoding

GOP structure

However for last GOP it might not work for some codecs if we don't copy the whole GOP (although I'm not quite certain of this). That said, from my experiments it works without problem regardless of the end marker position. But if you get any errors on that, just select the end of the GOP by selecting the next key frame, then go back exactly one frame

You can also use any other software that supports direct stream copy, like VirtualDub or FFMpeg

phuclv

Posted 2012-01-27T18:20:47.893

Reputation: 14 930

3

The absolute best program for this is VideoReDo, but a little pricey. I haven't been able to find a free program to even approximate VideoReDo, but TSSniper can do in a pinch.

Ben

Posted 2012-01-27T18:20:47.893

Reputation: 31

-1

I use MPEG Streamclip to cut the commercials out of the MPEG-TS recordings of my DVR.

MPEG Streamclip is available in a Windows version: http://www.squared5.com/svideo/mpeg-streamclip-win.html -- although I must admit that I have only been using the OS X version so far.

Jean Pierre Wenzel

Posted 2012-01-27T18:20:47.893

Reputation: 41

-1

Cuttermaran looks like the software program you're looking for. It also doesn't have a complicated GUI. However, it required that you have separate audio/video streams.

That shouldn't be an issue though as you can separate the audio/video streams easily using other software like TsRemux.

Vinayak

Posted 2012-01-27T18:20:47.893

Reputation: 9 310