Opened 9 months ago

Last modified 7 months ago

#7524 new enhancement

missing PCR timestamps in secondary streams with the MPEGTS muxer

Reported by: msiders Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mpegts
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:

When using the MPEG-TS muxer only the primary stream has PCR timestamps. And this behaviour can't be enhanced to mark additional substreams. It would be desirable to be able to mark other streams with PCRs.

Change History (7)

comment:1 Changed 9 months ago by msiders

I came up with a solution!

The current implementation of the MPEG-TS muxer only inserts PCR timestamps in the main stream. This stream is typically the video stream in a video service, or the audio stream in a radio service.

However, when multiple streams are mixed in the same MPEG-TS service, you may need to have more than one stream with time stamps. This is true when you will remux the service to create multiple services. For example, when you copy the different audio tracks from the service for creating additional radio services. Or when more than one video stream is included and in the remux you generate independent services.

To resolve this limitation, I created on myself a patch to insert the PCR timestamps in more than the first stream. This is completely optional, as it’s not a good idea to put PCRs in all streams (even if it’s not generate errors). Two new parameters are incorporated to mark all video streams and/or all audio streams.

The patch implements this optional behavior:

I hope it will accepted.

comment:2 Changed 8 months ago by msiders


Is Baptiste Coudurier <> the current maintainer of the MPEG-TS muxer?

I'm still waiting for someone to check this patch.

comment:3 Changed 8 months ago by msiders

  • Keywords mpegtsenc added

comment:4 Changed 8 months ago by cehoyos

  • Keywords mpegtsenc pcr removed

comment:5 follow-up: Changed 8 months ago by msiders


A new version of patch is provided:

I hope it will be accepted.

Last edited 8 months ago by msiders (previous) (diff)

comment:6 in reply to: ↑ 5 Changed 8 months ago by msiders

A new version of patch is provided:


I don't received any feeback about my patch v2.

I'd like to receive some comments. Or that it was accepted.

comment:7 Changed 7 months ago by neon18

  • Cc added
Note: See TracTickets for help on using tickets.