Lossless cutting of MPEG TS files in Windows [closed]
Solution 1:
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 type: I-FRM (00)
in the below screenshot (although the actual format may be changed, for example Frame:I(02)
in older versions)
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 (GOPs) that are encoded independently of each other, and contain pictures/frames in the stream. 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
However for the 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
- cut video and save as direct stream copy
- Simple lossless video editor for Windows with MP4 support
- How to Cut/Edit Video Without Re-encoding
- Virtualdub Direct Stream Copy - Friday Minis 138
Solution 2:
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.