[FFmpeg-devel] libavformat/mpegtsenc: fix incorrect PCR with multiple programs [v3]

Andreas Håkon andreas.hakon at protonmail.com
Mon Jul 29 14:20:27 EEST 2019


Hi Andriy,

A new updated version here: https://patchwork.ffmpeg.org/patch/14121/

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, 29 de July de 2019 8:46, Andriy Gelman <andriy.gelman at gmail.com> wrote:

> > The MPEG-TS muxer has a serious bug related to the PCR pid selection.
> > This bug appears when more than one program is used. The root cause is because
> > the current code targets only one program when selecting the stream for the PCR.
>
> I'd suggest to update the commit message because pid selection is not the main
> issue.

Done!


> > +        if (!service->pcr_st) {
> > +            av_log(s, AV_LOG_ERROR, "no PCR selected for the service %i", service->sid);
> > +            ret = AVERROR(EINVAL);
> > +            goto fail;
> > +        }
>
> Do you have to consider an edge case where the streams are not unique to each
> program?
> For example the following will return an error, whereas it works before the
> patch:
>
> ./ffmpeg -loglevel verbose -y -f mpegts -i day_flight.mpg \
> -map i:0x1e1 -c:v:0 copy \
> -program st=0 -program st=0 -f mpegts out-error.ts
>

Wow! A real edge case... Just solving it has involved a great rewriting.
However, it is worth considering as this patch is the prelude to another
(the one for real MPTS interleave muxing).


> Also, you are missing \n at the end of your error message.

Done!

Thank you Andriy for pointing this edge case.
Regards.
A.H.

---



More information about the ffmpeg-devel mailing list