[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):
v=0
o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4
s=SDP Seminar
i=A Seminar on the session description protocol
u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps
e=mjh at isi.edu (Mark Handley)
c=IN IP4 224.2.17.12/127
t=2873397496 2873404696
a=recvonly
m=audio 49170 RTP/AVP 0
m=video 51372 RTP/AVP 31
m=application 32416 udp wb
a=orient:portrait

David



More information about the Libav-user mailing list