[Libav-user] Encoding and Decoding on separate ends

David Longest david.longest at apx-labs.com
Mon Jan 21 19:02:57 CET 2013

Hello Vistas,

> I want to be able to open a video file on one end, encode it to h264 and then send it over RTP(custom library) to another end for decoding.
> I am not sure how exactly I am going to open the AVFormatContext and AVCodecContext on the receiving end. I am able to serialize AVPackets correctly.
> I am new to libav* and I can' t see how I need to initialize the AVFormat state on the decoding side.

I have recently been working with RTP data with h263. While I couldn't find a direct way to demux RTP packets, I found that providing the URL to a completed SDP file to avformat_open_input will allow ffmpeg to handle demuxing and decoding of the packets.

Example SDP from the RFC (http://tools.ietf.org/html/rfc2327):
o=mhandley 2890844526 2890842807 IN IP4
s=SDP Seminar
i=A Seminar on the session description protocol
e=mjh at isi.edu (Mark Handley)
c=IN IP4
t=2873397496 2873404696
m=audio 49170 RTP/AVP 0
m=video 51372 RTP/AVP 31
m=application 32416 udp wb


More information about the Libav-user mailing list