[FFmpeg-trac] #8039(avformat:new): mpegtsenc: incorrect PCR with multiple programs

FFmpeg trac at avcodec.org
Thu Jul 25 09:55:27 EEST 2019

#8039: mpegtsenc: incorrect PCR with multiple programs
             Reporter:  ahakon     |                     Type:  defect
               Status:  new        |                 Priority:  important
            Component:  avformat   |                  Version:  git-master
             Keywords:  mpegtsenc  |               Blocked By:
             Blocking:             |  Reproduced by developer:  0
Analyzed by developer:  0          |
 Summary of the bug:

 The MPEG-TS muxer has a '''serious''' bug related to the PCR pid
 This bug appears when more than one program is used. The root cause is
 the current code targets only one program when selecting the stream for
 the PCR.

 How to reproduce:

 [ test file "Day_Flight.mpg" from
 https://samples.ffmpeg.org/MPEG2/mpegts-klv/Day%20Flight.mpg ]

 % ffmpeg -loglevel verbose -y -f mpegts -i Day_Flight.mpg \
  -map i:0x1e1 -c:v:0 copy -map i:0x1e1 -c:v:1 copy \
  -program st=0 -program st=1 -f mpegts out-error.ts

 If you analyze the output, you can see that the file "out-error.ts" has
 marks in every packet of the pid 256 (a total of 561862 packets with PCR
 However, the pid 257 has 783 packets only with PCR marks.

 Current source code of the mpegts muxer only initializes the PCR of one
 program. Other programs are unintialized. And this is a bug.


Ticket URL: <https://trac.ffmpeg.org/ticket/8039>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list