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

Isaac Wang isaac.wang at visorcorp.com
Wed Sep 21 20:39:55 CEST 2011


On 9/20/2011 10:51 PM, Marlon Yao wrote:
> 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 
> <mailto: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 <mailto:Libav-user at ffmpeg.org>
>     http://ffmpeg.org/mailman/listinfo/libav-user
>
>
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
Where do I get the PTS from if I'm not using  a AVInputStream object?  
I've followed the tutorial on dranger.com but the PTS that I calculate 
from the method listed on that site is much too big.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110921/100103d9/attachment.html>


More information about the Libav-user mailing list