[Libav-user] rtp h264 stream too fast

Alex Cohn alexcohn at netvision.net.il
Mon Nov 14 16:21:34 CET 2011


On Mon, Nov 14, 2011 at 16:52, adreas Polyxronopoulos
<apolyxrono at yahoo.co.uk> wrote:
> So you mean to change the decoder side which in my case is the mplayer right?

My fault, I misunderstood your scenario.

> The total duration of the stream after starting the muxing.out(my
> executable) is about 7sec, but using the ffmpeg-command is around 52.6 sec.
> I think the problem is in the encoder-streamer side not at the decoder side,
> correct my if  i am wrong. I am calculating the PTS as follows:
> struct timeval  tv;
>         struct timezone tz;
>         struct tm      *tm;
>         gettimeofday(&tv, &tz);
>         tm = localtime(&tv.tv_sec);
>         int now = tm->tm_hour * 3600 * 1000 + tm->tm_min * 60 * 1000 +
> tm->tm_sec * 1000 + tv.tv_usec / 1000;
>         picture->pts = av_rescale_q(now, (AVRational){1, 10}, c->time_base);

You should fill in pts based on the desired frame rate, not
timeofday(). Also, your encoder which will replace the ffpmeg command
line should read the frames at expected rate (to avoid overflow of
rtp).

>  thanks a lot for the reply.
> Adreas Polychronopoulos

Cheers,
Alex


More information about the Libav-user mailing list