Hi everyone,

I would like to introduce a new feature in TSCutter.GUI: multi-source MPEG-TS repair.

GitHub project
Downloads

TSCutter.GUI is a lightweight application for navigating and cutting Transport Stream files at keyframe boundaries. It also includes TS checking, PCR/timeline repair, stream filtering and binary merging tools.

What does multi-source repair do?

Sometimes the same DVB or IPTV feed is recorded more than once, but every recording has defects in different places. A single-file repair tool cannot recover media data that is completely absent from that file, while another recording may still contain it.

Code:
Reference:  AAAA BBBB ???? DDDD
Donor:      AAAA ???? CCCC DDDD

                     |
                     v

Result:     AAAA BBBB CCCC DDDD
TSCutter.GUI uses matching content from auxiliary recordings to repair or reduce defects in a selected reference recording.

Potentially repairable problems include:
  • Missing TS packets and continuity-counter gaps
  • Packets marked with TEI
  • PES length or boundary corruption
  • Localised ES damage around confirmed fault regions
  • Short bursts containing many missing packets
  • Large missing intervals caused by recording, network or storage failures

Compatible sources

The files do not need identical PID assignments, PES boundaries or TS packetisation. They may also start and end at different times or retain different audio and subtitle tracks.

However, they must contain overlapping parts of the same encoded broadcast event. A repeat broadcast, transcoded video, resampled audio, or a source containing different regional inserts or advertisements is not interchangeable.

The current implementation supports standard 188-byte TS packets. It does not use visual similarity, interpolation or re-encoding: inserted media data must come from a compatible recording.

Large missing intervals

The tool can also search for continuous missing sections lasting several seconds or longer. Matching content before and after the gap is used as an anchor:

Code:
Reference:  ... [Anchor A] [     MISSING     ] [Anchor B] ...
Donor:      ... [Anchor A] [valid source data] [Anchor B] ...

                              |
                              v

Output:     ... [reference] [data from donor] [reference] ...
Because searching long recordings can be expensive, large-gap matching is offered as a separate advanced step. Repairable gaps are selected automatically after matching, but they can be reviewed and deselected before output.

How to use it

After downloading and extracting TSCutter.GUI, open:

Tools -> TS Multi-source Repair...

There is no need to open a video in the main window first.
  1. Add at least two recordings and select the reference file.
  2. Leave timeline normalisation enabled unless the source timelines are already known to align.
  3. Click Analyze Sources.
  4. If long gaps are detected, run the offered long-gap matching step.
  5. Review the repair map and results, then choose Repair and Output....

The reference file determines the output programme, tracks, beginning and end. Auxiliary files supply replacement data only; they do not add extra programmes or tracks.

Safety

Source files are opened read-only and are never modified. If the tool cannot establish a sufficiently safe match, the original region is left unchanged. The result is checked while it is written, and partial repairs may still report unresolved errors.

Screenshots

Image
[Attachment 93214 - Click to enlarge]


Image
[Attachment 93215 - Click to enlarge]


Image
[Attachment 93216 - Click to enlarge]


Image
[Attachment 93217 - Click to enlarge]


The feature is still evolving, so feedback and testing with real-world DVB/IPTV recordings are very welcome.