<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">So you mean to change the decoder side which in my case is the mplayer right ? </div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">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:</div><div><div><br></div><div><span class="Apple-style-span" style="font-size: 13px; "><span class="Apple-tab-span" style="white-space:pre">        </span>struct timeval  tv;</span><br></div><div><font class="Apple-style-span" size="2">        struct timezone tz;</font></div><div><font
 class="Apple-style-span" size="2">        struct tm      *tm;</font></div><div><font class="Apple-style-span" size="2">        gettimeofday(&tv, &tz);</font></div><div><font class="Apple-style-span" size="2">        tm = localtime(&tv.tv_sec);</font></div><div><font class="Apple-style-span" size="2">        int now = tm->tm_hour * 3600 * 1000 + tm->tm_min * 60 * 1000 + tm->tm_sec * 1000 + tv.tv_usec / 1000;</font></div><div><font class="Apple-style-span" size="2">        picture->pts = av_rescale_q(now, (AVRational){1, 10}, c->time_base);</font></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "> thanks a lot
 for the reply.</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><span style="font-weight: bold; color: rgb(91, 91, 91); font-family: 'comic sans ms'; ">Adreas Polychronopoulos</span><br style="font-weight: bold; color: rgb(0, 0, 255); font-family: 'comic sans ms'; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Alex Cohn <alexcohn@netvision.net.il><br><b><span style="font-weight: bold;">To:</span></b> "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." <libav-user@ffmpeg.org><br><b><span style="font-weight: bold;">Sent:</span></b> Monday, 14 November 2011, 16:13<br><b><span
 style="font-weight: bold;">Subject:</span></b> Re: [Libav-user] rtp h264 stream too fast<br></font><br>> 2) The duration of the file is 52.6 sec (526 total frames @ 10 fps),  in the<br>> above ffmpeg command the -re option forces ffmpeg to read the file in native<br>> frame rate at 10fps. How can i do this from my source code ? Should i<br>> implemented and how ? Is there any value to set in any libav structure ?<br>> thanks in advance<br>><br>> andreasP<br><br>To the best of my knowledge you can get the pts values for decoded<br>frames, or you can estimate them from frame number and the expected<br>FPS (in your case, you don't have to worry about variable frame rate<br>and other exotics). From this pts you determine how long to sleep<br>between calls to decode_video or render.<br><br>Good luck,<br>Alex<br>_______________________________________________<br>Libav-user mailing list<br><a ymailto="mailto:Libav-user@ffmpeg.org"
 href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br><a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br><br><br></div></div></div></body></html>