[Libav-user] Native Frame Rate "-re" option?

Marlon Yao yaolei135 at gmail.com
Wed Sep 21 07:51:29 CEST 2011

just compare pts to current timestamp, then invoke usleep. see ffmpeg.c:

        if (rate_emu) {
            int64_t pts = av_rescale(ist->pts, 1000000, AV_TIME_BASE);
            int64_t now = av_gettime() - ist->start;
            if (pts > now)
                usleep(pts - now);

On Wed, Sep 21, 2011 at 6:37 AM, Isaac Wang <isaac.wang at visorcorp.com>wrote:

> Hello,
> I'm trying to stream a UDP video stream in its native frame rate using the
> ffmpeg libraries, but am having difficulty in doing so.  Right now, I can
> display the stream but at first the stream is displayed very quickly (aka a
> higher frame rate than the native one) until eventually it displays the
> video in a stuttering manner.  I read that if you pass "-re" to ffmpeg via
> the command line, ffmpeg will be able to detect the native frame rate and
> display the video with that rate, but I can't find any documentation
> detailing how to do this using the C libraries.  Any help would be
> tremendously appreciated!
> ______________________________**_________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/**listinfo/libav-user<http://ffmpeg.org/mailman/listinfo/libav-user>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110921/07bb45a1/attachment.html>

More information about the Libav-user mailing list