[Libav-user] How to save RTP stream to a file?

孙大伟 sundawei at gmail.com
Thu May 12 05:13:14 CEST 2011


Hi all,
    I got RTP strem from a IP camera, decode ervery frame and display it,
and now I want to save the stream to file for later playing.
    My question is, can i directly save AVPacket data to a file, like the
following:

       while(av_read_frame(pFormatCtx, &packet)>=0) {
        if(packet.stream_index==videoStream) {
            here I write packet.data to a file.

    After doing that, I got a file,and with the same program I play it.Is
this process correct?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110512/8fd51013/attachment.html>


More information about the Libav-user mailing list