[Ffmpeg-devel] FFServer and RTSP

Luca Abeni lucabe72
Mon Apr 16 11:08:14 CEST 2007

Hi Alex,

Alex Beregszaszi wrote:
> Hi,
>> Even not considering the crashes, ffserver has some other "funny 
>> behaviour" when streaming RTP: for example, the first two frames read 
>> from the file have the same PTSs and DTSs, sometimes resulting in a 
>> "error, non monotone timestamps 45000 >= 45000 st:1" error when trying 
>> to stream them (I say sometimes, because if the first PTS is 0 then the 
> The timing is broken in .ffm. I'm cleaning it up, but didn't managed to
> share all the patches yet.
Well, for my test I did not use an ffm. I was just trying to stream a 
.mpg file (containing MPEG1 video and mp2 audio) via RTP.
Anyway, after some other testing I discovered that this problem is due 
to the fact that av_read_frame() is called before calling 

After fixing this, there are other problems due to the fact that the 
MPEG file contains 2 streams, sent over 2 different RTP streams... And 
ffserver is kind of confused in deciding when to send an RTP packet (it 
does not consider the "interleaving" between the PTSs of the two streams).

>> error does not occourr...). I think the error is due to the fact that 
>> the file is opened (with av_open_input_file()), but 
>> av_find_stream_info() is not invoked...
>> Is it legal to open a file for reading (av_open_input_file()), and start 
>> reading frames from it without performing an av_find_stream_info()?
> Did you found that in the HTTP part too?
Sorry, I did not look at HTTP... I think HTTP is used with .ffm feeds, 
right? So, frames are read using a different code (if I understand the 
ffserver code correctly), and I do not know about this different 
codepath (anyway, I just saw that av_find_stream_info() is called on the 
feed file... So maybe HTTP is ok).

>> Anyway, it seems to me that ffserver is in a very bad shape regarding 
>> RTSP/RTS streaming...
>> So I'd like to have an opinion from other people (an opinion from the 
>> official maintainer would be appreciated :): is there any hope in fixing 
>> ffserver for RTP streaming? (did it ever work, at least one time?).
> Sadly I don't really know the RTP/RTSP part of the code, was fixing only
> overall bugs and HTTP part, which works for me quite reliable. We are
> usin git now for 3 months, without any crashes.
Yes, after looking again at the code in this weekend I saw that the 
problems I found seem to be "RTP only" things.


More information about the ffmpeg-devel mailing list