Thanks for your reply.By "control frame rate" I meant,say,the video file itself is 25fps, and I wanna play the video with the speed of 10frame/s.<br><br>Cheers<br><br><div class="gmail_quote">2011/12/20 Michael Chisholm <span dir="ltr"><<a href="mailto:chisholm@mitre.org">chisholm@mitre.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've struggled myself with this.  There are a lot more framerate-related fields than that lying around.  The ones I know of (in ffmpeg 0.6.3) are (stream=AVStream, cc=AVCodecContext):<br>

<br>
stream->time_base<br>
stream->r_frame_rate<br>
stream->avg_frame_rate<br>
cc->time_base<br>
cc->ticks_per_frame<br>
<br>
(you'd think you could maybe derive framerate from the last)  I am no expert, but my guess is that not all containers contain a framerate field somewhere for tools to read.  So libav* tries to estimate one from timing information.  E.g. in my app I can read from a udp multicast network stream, and even for the same stream, each time I run the app, it shows a slightly different framerate (as shown by dump_format). Maybe because it sees a different subsequence of timestamps, or the relative distribution in time of those timestamps might be slightly different, ... I don't know.  In my app, I settled on stream->avg_frame_rate for my purposes.<br>

<br>
As far as controlling it, I'm not sure what you mean... did you just want to decode at the frame rate of the stream, or somehow manipulate the the video to change its framerate?<br>
<br>
Andy<div class="im"><br>
<br>
On 12/19/2011 1:25 AM, Yingzhou Zhang wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
hey there.<br>
<br>
I have googled a little bit,found 2 way<br>
1:AVFormatContext->streams-><u></u>time_base.num/den?<br>
2:AVCodecContext->  streams->r_frame_rate?<br>
<br>
However the output of the 2 ways are not the same??<br>
<br>
Could you tell me what is the exact way to get frame_rate and how to<br>
control it when decoding video?<br>
<br>
Thanks a lot<br>
<br>
<br>
<br></div>
______________________________<u></u>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/<u></u>listinfo/libav-user</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/<u></u>listinfo/libav-user</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div><br></div>---------------------<br><div>Best Regards</div><br>