Please observe the following general remarks regarding PCR conditioning in dvbmux
The PCR tracking engine is configured on a per-group basis. The feature is activated by providing a PCR PID for a group by using the group [group name] pcr pid [stream PID] command. This command causes dvbmux to start tracking and re-stamping PCRs conveyed in the specified destination PID, as well as signal this PID as the PCR PID in the relevant Program Map Table.
The show group [group name] pcr command can be used to verify that PCR tracking is in operation.
# show group Cinemax pcr === PCR tracking of group 'Cinemax'. T_PCR = 27337385647 + 99/300 Sample Arrival timestamp Offset PCR Pcr jitter ------------------------------------------------------------------------- | 0 | 3551189.836343545 | 33.2 ms | 27337385638 | 79/300 | -267.86 us | 1 | 3551189.803126157 | 31.6 ms | 27337382633 | 89/300 | -271.94 us | 2 | 3551189.771536645 | 26.9 ms | 27337379790 | 228/300 | -266.23 us | 3 | 3551189.744633398 | 33.2 ms | 27337377381 | 112/300 | -267.68 us | 4 | 3551189.711426830 | 31.8 ms | 27337374379 | 125/300 | -282.56 us | 5 | 3551189.679598226 | 26.7 ms | 27337371527 | 257/300 | -271.70 us (...)
If a PCR PID is specified within a group configuration context, PCR re-stamping for this group is automatically enabled on every output the group is attached to.
To disable PCR re-stamping for a specific PID group, use the group [group name] no pcr restamp command.
Please note that when PCR PID is configured for a group, dvbmux will remove PCRs from Adaptation Fields in elementary streams of the group other than the PCR stream.
Without any additional configuration, dvbmux will only alter PCR values in packets that already contain an Adaptation Field, with PCR value present.
It is however highly recommended to configure PCR repetition interval using group [group name] pcr interval [N]. This will cause dvbmux not only to re-stamp PCR values already present in the stream, but also insert additional PCR information, so that a PCR value is present within the PCR PID ES at least every N milliseconds. The additional PCR information is inserted in form of empty MPEG packets (no payload) on the PCR PID with their Adaptation Fields containing the current PCR value.
Another form of this command, group [group name] pcr interval [N] - [M], will cause dvbmux to insert and remove PCR samples on the PCR PID ES so that PCR values are separated in time by no more than M milliseconds and no less than N milliseconds. Consider eg. group [group name] pcr interval 40 - 40.
Use the show output [output name] pcr command to verify that PCR conditioning is taking place on a specific output:
# show output TS1 pcr === PCR restamping at output 'TS1' Group name # Inserts # Restamps # Removals ----------------------------------------------------------- | Cinemax | 0 | 151952 | 0 | SferaTV | 193190 | 0 | 220710
The subsequent counters indicate:
By default, for every group the PCR is taken from and updated on the same PID. However, dvbmux also supports moving the PCR information from one PID to another. After configuring the PID on which the PCR is to be placed on with group [group name] pcr pid [PID], dvbmux can be told to track the PCR from another PID by using the group [group name] pcr track pid [PID] command. Alternatively, the source PCR PID can be selected while mapping it to the group, ie. group [group name] map from [input name] pid [PID] track-pcr.
Please note that both PIDs are specified in terms of destination PID. This means that in case the elementary stream containing the PCR is to be discarded, an empty mapping has to be used so that the PID actually is redirected to the group from the input, but not routed to outputs (ie. group [group name] map from [input name] pid [source PCR PID] to null track-pcr ).
The input PCR variations are lowpass filtered, so that PCR jitter caused by random network latency or OS scheduling granularity evens out. The filter depth can be configured using system pcr filter-depth [N]. By default, N = 262144. The larger N is, the more resistant the engine is to random fluctuations. Too large N may cause the engine to be unable to compensate for slight PCR frequency mismatches between signal source and the operating system dvbmux is running on.
The PCR tracking engine ignores rapidly successing PCR samples. By default, only samples arriving 10 milliseconds after the last accepted PCR sample are considered. This interval can be altered by system pcr min-interval [N]
The PCR tracking feature can be disabled globally by issuing system pcr no track. PCR insertion and re-stamping can be disabled by system pcr no restamp. Disabling PCR tracking will automatically disable PCR insertion and re-stamping.