[FFmpeg-devel] [PATCH] Fix output rate of mpegts CBR muxer

Baptiste Coudurier baptiste.coudurier
Wed Apr 21 09:55:20 CEST 2010


Hi,

On 4/21/10 12:28 AM, Dan Dennedy wrote:
> Hi,
> Currently, the mpegts muxer outputs a higher rate than requested using
> -muxrate due to the cur_pcr accumulating division truncation errors.
> For a 10 mbps stream, I see about 172 kbps higher than I requested.
> This fixes it by simply counting packets and then taking the division
> only when PCR is actually needed.
>
> Index: libavformat/mpegtsenc.c
> ===================================================================
> --- libavformat/mpegtsenc.c	(revision 22926)
> +++ libavformat/mpegtsenc.c	(working copy)
> @@ -60,6 +60,7 @@
>       int nb_services;
>       int onid;
>       int tsid;
> +    uint64_t pcr_delay;

Is a field really necessary ?

It seems pcr is only written at 2 places.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list