Parsing raw VP8

1,543 views
Skip to first unread message

rohan

unread,
Jul 19, 2011, 6:00:12 PM7/19/11
to WebM Discussion
Hi guys,

Can VP8 be parsed raw? I'd like to avoid the overhead of implementing
a packetizer and/or depacketizer, and I'm streaming just video (no
audio) data to a client over a TCP socket.
I've set up ffmpeg to output the video with "rawvideo" format using
libvpx as the video codec. I then stream this to a client over TCP.

On the client end, I've tried using ffmpeg to decode the stream by
passing the packets I receive into the decoder (using ffmpeg's ffvp8
decoder), but it throws errors like:
[vp8 @ 0xa7de00] Header size larger than data provided
and
[vp8 @ 0xa7de00] Unknown profile 5

Is there a straightforward to parse VP8 into packets that the decoder
will understand?

Thanks,
Rohan

Vladimir Pantelic

unread,
Jul 19, 2011, 6:17:20 PM7/19/11
to webm-d...@webmproject.org
On 07/20/2011 12:00 AM, rohan wrote:
> Hi guys,
>
> Can VP8 be parsed raw? I'd like to avoid the overhead of implementing
> a packetizer and/or depacketizer, and I'm streaming just video (no
> audio) data to a client over a TCP socket.

you can always add like a 4 byte header that tells you the size of
the next VP8 packet....

rohan

unread,
Jul 19, 2011, 6:31:18 PM7/19/11
to WebM Discussion
Yup, though that would still require me editing the source of the
encoder (right now I just use the ffmpeg executable). Certainly an
option and it's what I'll try next, but I was wondering if the VP8
bitstream itself could be parsed raw - either through perhaps its own
packet header or delimiters (as in H.264 Annex-B)?

ffmpeg was able to parse a raw XviD stream, and using av_parser_parse
I could parse H.264 Annex-B as well.

John Koleszar

unread,
Jul 19, 2011, 8:10:34 PM7/19/11
to webm-d...@webmproject.org

Generally speaking vp8 can't be parsed without some sort of container. If you're just using a pipe from the ffmpeg binary you could try the ivf container. You can do better if you're using the API directly.

> --
> You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
> To post to this group, send email to webm-d...@webmproject.org.
> To unsubscribe from this group, send email to webm-discuss...@webmproject.org.
> For more options, visit this group at http://groups.google.com/a/webmproject.org/group/webm-discuss/?hl=en.
>

Ralph Giles

unread,
Jul 19, 2011, 6:14:01 PM7/19/11
to webm-d...@webmproject.org
On 19 July 2011 15:00, rohan <hanr...@gmail.com> wrote:

> Can VP8 be parsed raw? I'd like to avoid the overhead of implementing
> a packetizer and/or depacketizer, and I'm streaming just video (no
> audio) data to a client over a TCP socket.
> I've set up ffmpeg to output the video with "rawvideo" format using
> libvpx as the video codec. I then stream this to a client over TCP.

Not really. It might be possible to determine the length of some
packets by parsing them, but the decoder api expects to be pointed at
the frame boundaries, so you'd have to do this yourself. There's not
much of a start sequence either, so if you ever got off sync it would
be hard to recover.

The normal thing to do in such cases, is just to write the length in
bytes before each packet, e.g. as a 4-byte integer. Then you can
easily split the stream back at the other end.

HTH,
-r

rohan

unread,
Jul 20, 2011, 4:36:38 PM7/20/11
to WebM Discussion
On Jul 19, 8:10 pm, John Koleszar <jkoles...@google.com> wrote:
> Generally speaking vp8 can't be parsed without some sort of container. If
> you're just using a pipe from the ffmpeg binary you could try the ivf
> container.
Awesome. Using IVF did it. Easy enough to right a quick parser and it
gave me frame sizes so the decoder worked correctly.

> You can do better if you're using the API directly.

Can you explain this a little further? What sort of improvements do
you get by using the VP8 API directly?

Reply all
Reply to author
Forward
0 new messages