On Thu, Mar 24, 2016 at 03:14:56PM -0400, Predrag Filipovic wrote: > PCR insertion with specified period is functional when muxrate > is also specified (contant bitrate) as required by DVB and ATSC > (and other) specifications. Feature was non-functional for > variable bitrate (muxrate not specified). Insertion timing > is based on video frame keys and frame period (dts) thus, in > this patch (work in progress), pcr period precision is limited > to +/- one video frame period > > Signed-off-by: Predrag Filipovic <pred...@agora-cs.com> > --- > libavformat/mpegtsenc.c | 80 > +++++++++++++++++++++++++++++++++++++------------ > 1 file changed, 61 insertions(+), 19 deletions(-) > > diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c > index 7656720..8600ba6 100644 > --- a/libavformat/mpegtsenc.c > +++ b/libavformat/mpegtsenc.c > @@ -105,6 +105,7 @@ typedef struct MpegTSWrite { > int tables_version; > double pat_period; > double sdt_period; > + int64_t last_pcr_ts; > int64_t last_pat_ts; > int64_t last_sdt_ts; > > @@ -903,6 +904,9 @@ static int mpegts_init(AVFormatContext *s) > ts_st = pcr_st->priv_data; > > if (ts->mux_rate > 1) { > + if (ts->pcr_period >= INT_MAX/2) { > + ts->pcr_period = PCR_RETRANS_TIME; > + } > service->pcr_packet_period = (int64_t)ts->mux_rate * > ts->pcr_period / > (TS_PACKET_SIZE * 8 * 1000); > ts->sdt_packet_period = (int64_t)ts->mux_rate * > SDT_RETRANS_TIME / > @@ -931,10 +935,19 @@ static int mpegts_init(AVFormatContext *s)
this patch contains random linebreaks and cannot be applied as a result make sure your MUA doesnt wordwrap the patch [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Democracy is the form of government in which you can choose your dictator
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel