[Libav-user] latency of mpegts handling in libavformat
carmel.work at gmail.com
Sun Jul 31 08:21:56 CEST 2011
It's a bit complicated to post the code.
However, I did try to init the parameters on the encoder side, it didn't
seem to do tny good.
2011/7/27 Alex Cohn <alexcohn at netvision.net.il>
> On Wed, Jul 27, 2011 at 17:23, כרמל מגן <carmel.work at gmail.com> wrote:
>> I am sending and receiving h.264 video on mpeg2-ts over udp.
>> After noticing some lag, I added code that prints a timestamp and
>> framenumber after sending and after av_read_frame returns. when comparing
>> timestamps between frames with the same frame number, there is a ~60 ms
>> delay (when sending 30 fps). Furthermore, if I stop at a breakpoint and
>> delay the sending of frame number X, the timestamp of receiving frame number
>> X-2 corresponds to the time of sending of X (i.e., the time between
>> receiving frame number X-3 and frame number X-2 is longer if I delay the
>> sending of X longer). The unavoidable conclusion is that av_read_frame *does
>> not return* with frame X-2 until frame X starts arriving.
> av_read_frame takes an AVFormatContext* as the first parameter. How did you
> create this object on the receiver side? Can you post the relevant code
> And I still suspect that your sender used msx_b_frames == 2 when it
> initialized the AVCodecContext* encoderContext for avcodec_open().
> Libav-user mailing list
> Libav-user at ffmpeg.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user