[Libav-user] RTP VP8 payload, keyframe, the proper way to send correct RTP VP8 packets

William MANCON wmancon at gmail.com
Mon Oct 19 14:44:25 CEST 2015

I'm trying to write a plugin for a webrtc gateway (Janus). Basicaly, the
code deals with incomping RTP packet (not SRTP, as the gateway decrypt et
demux RTCP ...), depacketize it, decode it with the use of
avcodec_decode_video2. Some manipulations are made on the raw outputted
frames and then frame are encoded with avcodec_encode_video (not
avcodec_encodevideo2 because it's not available on my system for a
mysterious reason. )

Then, with the use of libavformat I write the encoded frame in "rtp" (tu
specific url rtp://
another plugin of the gateway send the stream to a list of participant.

But, nobody could render the video. Chrome send a pli for each packet
received. So i tried to force the encoder to send a keyframe :

if(complete_frame%140 == 0)
                    m_pFrame->pict_type = FF_I_TYPE ;
just before the call of avcodec_encode_video

But nothing change.
After some investigations i discovered strange things in the output of the
decoder :

I tried to parse header of packets from avcodec_encode_video and it never
contain this :

/* vet via sync code */
                        JANUS_LOG(LOG_WARN, "First 3-bytes after header not
what they're supposed to be?\n");

the "keyframe marker". But all packet contains xbit = 1, sbit = 1 and pbit
= 0. That is what we have in the case of a keyframe.

Also i get this message from the lib when beginin the process : RTP VP8
payload implementation is incompatible with the latest spec drafts.

The question is, what is the proper way to get valid VP8 packets and RTP
VP8 packet.
I need to set the correct RTP payload for the streamer configuration so how
can I access to it through libavformat ?

Thanks a lot for your advices.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20151019/c25f6b21/attachment.html>

More information about the Libav-user mailing list