[FFmpeg-devel] Force PCR pid in a PROGRAM

Andreas Håkon andreas.hakon at protonmail.com
Tue Jun 4 13:30:01 EEST 2019


Before coding of a new patch, I prefer to ask here for your ideas and thus improve the changes
of acceptance of the patch.

I posted before a patch to select which pid will carry the PCR timestamps. This makes sense in
several scenarios: when using a non-video stream to carry PCR, when using multiple video
streams, and son on. See it here:

However, this patch doesn’t support multiple programs, as only one stream can be specified.
Therefore, I like to improve it to allow the selection of the PCR for each program.

But, I’m not sure about what the best approach is. Here are some options:

- Enhance the “mpegtsenc” muxer with a multi-program option for selecting the PCR.
- Use the “-program” general parameter to mark which stream carries the PCR.


$ “ffmpeg ... -f mpegts --progid_pcr_pid 1=101 ...”
   This indicates that for program with id 1 the PCR will be in the pid 101.
$ “ffmpeg ... -program title=Prog1:st=0,pcr:st=1 -f mpegts ...”
   Here the first stream in the Prog1 will carry the PCR.

Please comment on what you prefer/suggest.
A. H.


More information about the ffmpeg-devel mailing list