PID Remapping

PID Remapping #

Introduced in Nimbra Edge R4.0 as an optional feature

The PID Remapping transformation enables manipulation of PIDs (Packet Identifiers) within a transport stream. This transformation allows you to remap PIDs to different values, drop unwanted PIDs, or filter out entire programs from the stream.

Program filter #

The program filter allows you to select specific programs to keep in the output stream. All other programs will be removed.

  • If no programs are specified, all programs are preserved
  • Program number 0 is reserved and always preserved

graph TB subgraph Input["Input Stream"] P1["Program 1 (ID: 100)
Video: PID 256
Audio: PID 257"] P2["Program 2 (ID: 200)
Video: PID 512
Audio: PID 513"] P3["Program 3 (ID: 300)
Video: PID 768
Audio: PID 769"] end Input --> Filter[Program Filter
Keep: 100, 300] Filter --> Output["Output Stream
Program 1: PIDs 256, 257
Program 3: PIDs 768, 769"] style Input fill:#e1f5ff style Output fill:#d4edda

PID rules #

PID rules define how individual PIDs are handled in the output stream. Each rule has a condition that matches specific PIDs and an action that determines what happens to matching packets.

Rules are evaluated in the order they are defined. Once a PID matches a rule, that rule’s action is applied.

Conditions #

Condition Description
Specific PID Match a single PID (valid range: 32-8190)
Any video stream Match any PID declared as a video stream in PMT
Any audio stream Match any PID declared as an audio stream in PMT
SDT Match Service Description Table packets

Actions #

Action Description
Remap to PID Change the PID to a specific new value (valid range: 32-8190)
Drop Remove all packets with matching PIDs from the output (saves bandwidth)
Remap to range Automatically assign PIDs within a specified range (only available for “any video” and “any audio” conditions)

Remap to specific PID #

Use this action to change a specific PID to a new value.

graph LR subgraph Input["Input Stream"] I1["Video: PID 256"] I2["Audio: PID 257"] end subgraph Remap["PID Rules"] R1["256 → 100"] R2["257 → 101"] end subgraph Output["Output Stream"] O1["Video: PID 100"] O2["Audio: PID 101"] end I1 --> R1 --> O1 I2 --> R2 --> O2 style Input fill:#e1f5ff style Output fill:#d4edda

Drop PIDs #

Use this action to remove unwanted PIDs from the output stream. This reduces bandwidth by eliminating the packets entirely.

graph LR subgraph Input["Input Stream"] I1["Video: PID 256"] I2["Audio 1: PID 257"] I3["Audio 2: PID 258"] end subgraph Rules["PID Rules"] R1["258 → Drop"] end subgraph Output["Output Stream"] O1["Video: PID 256"] O2["Audio 1: PID 257"] end I1 --> O1 I2 --> O2 I3 --> R1 style Input fill:#e1f5ff style Output fill:#d4edda

Remap to range #

When using “any video stream” or “any audio stream” conditions, you can automatically assign PIDs within a specified range. This is useful when you want to standardize PID assignments across multiple streams.

graph LR subgraph Input["Input Stream"] I1["Video 1: PID 256"] I2["Video 2: PID 512"] I3["Audio 1: PID 257"] I4["Audio 2: PID 513"] end subgraph Rules["PID Rules"] R1["Any video → Range 100-199"] R2["Any audio → Range 200-299"] end subgraph Output["Output Stream"] O1["Video 1: PID 100"] O2["Video 2: PID 101"] O3["Audio 1: PID 200"] O4["Audio 2: PID 201"] end I1 --> R1 --> O1 I2 --> R1 --> O2 I3 --> R2 --> O3 I4 --> R2 --> O4 style Input fill:#e1f5ff style Output fill:#d4edda

Muxer settings #

Bitrate #

As the stream will be remuxed after the changes are applied, a muxrate (Total stream bitrate) can be specified.

Setting this value will make the output CBR (Constant Bitrate), padding the stream with null packets to reach the specified bitrate.

If left empty, the output will be VBR (Variable Bitrate).

Limitations #

Input stream #

The input stream may have no more than:

  • 16 PIDs, of which no more than:
  • 8 programs
  • 8 SCTE 35 PIDs

If the requirements are not met, the transformation will not output any data, i.e. no packets will be sent at all.

Example use cases #

Remove unwanted audio tracks #

To remove specific audio tracks while keeping video:

  1. Add a rule: Match PID 258 → Drop
  2. Add a rule: Match PID 259 → Drop

Standardize PID assignments #

To ensure consistent PID numbering across different sources:

  1. Add a rule: Any video stream → Remap to range 100-199
  2. Add a rule: Any audio stream → Remap to range 200-299

Remove SDT packets #

To remove Service Description Table packets from the output:

  1. Add a rule: SDT → Drop

Filter to specific program #

To keep only program 42 from a multi-program stream:

  1. Set Program filter to: 42