<div>Hello</div><div><br></div><div>I have faced with a task to develop an application that has to receive an RTSP (audio + h.264 video) stream from an Axis IP camera. Basically what I need to do is to consume this stream reliably (i.e., I can't afford my application to crash if there's some network delay) and export it into a file + decode video and do some processing on decoded frames.</div>
<div><br></div><div>Searching in google and through the mailing list, I have found a lot of complaints about the fact that ffmpeg application (not the libavformat library itself, as i understand) has some issues with receiving RTSP stream (carried by UDP packets). </div>
<div>I actually launched ffmpeg trying to see how it actually works "out-of-the-box":</div><div><br></div><div>./ffmpeg/ffmpeg -i 'rtsp://<a href="http://a11.l1857056010.c18570.g.lq.akamaistream.net/D/11/18570/v0001/reflector:56010">a11.l1857056010.c18570.g.lq.akamaistream.net/D/11/18570/v0001/reflector:56010</a>' -vcodec copy -acodec copy -t 3600 -y 'nasa.mp4'</div>
<div><br></div><div>(this is NASA translation)</div><div>and after few minutes (or seconds) of recording I get some kind of error or ffmpeg just stops recording and quits.</div><div>Well I have a lot to learn and I hope this issue is caused by the application and not by the library itself.</div>
<div><br></div><div>What I would like to do now - is to do some experiments and write a simple application that can connect to the RTSP server and start "reading" the stream, transforming it into a series of AVFrame's that I could display using SDL, or edit and save/export.</div>
<div><br></div><div>I've played with ffmpeg and SDL (thanks to an awesome Stephen Dranger's tutorial) for a while, so far. But that is, of course, not enough.</div><div>I have found documentation for the RTSP-related functions of libavformat: <a href="http://ffmpeg.org/doxygen/0.6/rtsp_8h.html">http://ffmpeg.org/doxygen/0.6/rtsp_8h.html</a> but as a newbie I couldn't build a working application that can retrieve the stream. I don't even know in what order to call these functions. I'd use ffmpeg.c as an example, but it seems to be huge, I am getting lost in it.</div>
<div><br></div><div>Can you point me in the right direction? Maybe a similar question has been answered already, but I missed this answer?</div><div>How are streaming applications like the one i need to create, built usually (what kind of architecture the applications should have)? How a simple streaming application? Do the problems with the ffmpeg library (unreliability of RTSP recording) extend on libavformat?</div>
<div><br></div><div>I am sorry for unspecific questions (I believe the answer would require a whole article to be written :) ), but basically I am asking for a simple sketch and basic ideas I need to delve into.</div><div>
<br></div><div>Thank you for everyone who will find some time to respond!<br></div><div><br></div>