[FFmpeg-devel] [bug/patch] MPEG-TS muxer: PCR not in sync with PTS/DTS

Niobos niobos.be
Wed Jul 29 11:18:26 CEST 2009


On Tue, Jul 28, 2009 at 8:07 PM, Baptiste Coudurier <
baptiste.coudurier at gmail.com> wrote:

> > @@ -429,9 +429,10 @@
> >          /* PES header size */
> >          if (st->codec->codec_type == CODEC_TYPE_VIDEO ||
> >              st->codec->codec_type == CODEC_TYPE_SUBTITLE)
> > -            total_bit_rate += 25 * 8 / av_q2d(st->codec->time_base);
> > +            total_bit_rate += (19*8 + 92*8) /
> av_q2d(st->codec->time_base); /* 19B PES header every frame */
> > +
>  /* on average 92B of padding at the end of every packet */
> >          else
> > -            total_bit_rate += total_bit_rate * 25 /
> DEFAULT_PES_PAYLOAD_SIZE;
> > +            total_bit_rate += (14*8 + 92*8) * 7; /* 14B PES header 6.7
> times a second */
>
> Sorry, but can you please explain the audio header size, it should
> depend on codec bit rate and DEFAULT_PES_PAYLOAD_SIZE, I think.


 As I already noticed in my first mail:

> The PES overhead is correct for my specific case (1 PES per video frame, 1
> PES per 150ms audio), but might need some work to be more generic.

The audio header is 14B in the output stream I analyzed. I Don't know enough
about PES to write better code.

I think it would be easier to generate a CBR transport stream, however
>
I think it's good to generate a VBR ts if it works :)

Well, for my purpose, a VBR would be very nice, so I'll look into that.



More information about the ffmpeg-devel mailing list