[FFmpeg-soc] vp8 de/packetizers

Josh Allmann joshua.allmann at gmail.com
Fri Jul 30 10:36:15 CEST 2010


On 30 July 2010 00:22, Martin Storsjö <martin at martin.st> wrote:
> On Thu, 29 Jul 2010, Josh Allmann wrote:
>
>> Here is a packetizer and a depacketizer for VP8 RTP.
>>
>> Playback is only semi-smooth; it drops way too many frames. The
>> depacketizer likes to claim it gets an extra packet after the
>> frame-end (which is typically one byte smaller than the actual
>> frame-end packet). Still a work in progress.
>
> Didn't feel any significant frame dropping here (btw, if playing with
> ffplay, make sure you use -noframedrop, sometimes ffplay constantly feels
> it's behind and needs to drop some frames to catch up, but since the
> source is realtime, it still has to block for more frames, so it
> constantly drops frames), but the playback console is spammed with
> messages like this:
>
> [vp8 @ 0x10188fe00] Unknown profile 6
> [vp8 @ 0x10188fe00] Header size larger than data provided
> [rtsp @ 0x10202dc00] Received no start marker; dropping frame
>

-noframedrop helped, but the last message is what I am concerned with;
it really should not happen. Those seem like phantom packets.

> In general, this looks quite ok (I haven't read the spec, but from the
> code it looks quite simple), here's a quick initial review:
>

It is basically raw RTP with the addition of two bits, one to mark
keyframes, and another to mark the start of a frame. I made a few
assumptions here that were not covered by the spec:*

-Those bits are located at the first byte prior to the data payload.
-The sdp rtpmap codec ID is "VP8."

*https://groups.google.com/a/webmproject.org/group/webm-discuss/browse_thread/thread/550f946b0e22ead2#

>> +    keyframe = ( !(*buf & 1) ) << 3;
>> +
>
> I guess this could be written a little less convoluted as
>
> keyframe = *buf & 1 ? 0 : 8;
>
> but that's mostly bikeshedding. :-)
>

Fixed, since it is clearer that way.

>> +    *s->buf_ptr++ = keyframe | 4; // 0b100 indicates start of frame
>> +    while (size > 0) {
>> +        len = size > max_packet_size ? max_packet_size : size;
>
> len = FFMIN(size, max_packet_size);
>

Fixed


>> +    int start_packet    = *buf & 4;
>> +    int end_packet      = flags & RTP_FLAG_MARKER;
>> +    int is_keyframe     = *buf & 8;
>
> Keep in mind that buf can be NULL
>

Fixed.

Josh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-RTP-packetization-of-VP8.patch
Type: text/x-patch
Size: 2682 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20100730/2852ce3a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-RTP-depacketization-of-VP8.patch
Type: text/x-patch
Size: 6386 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20100730/2852ce3a/attachment-0001.bin>


More information about the FFmpeg-soc mailing list