metadata for SimpleBlock

134 views
Skip to first unread message

MS

unread,
Oct 3, 2012, 5:58:03 PM10/3/12
to webm-d...@webmproject.org
Hi,

If I want to mux vp8 data how do I go about it? Can I start writing the vp8 encoded data into the "SimpleBlock" structure of a Cluster? How do I get the metadata to go with it? How can I find out what are key frames etc?

Really appreicate the help.

Thanks,

MS

John Koleszar

unread,
Oct 3, 2012, 7:41:42 PM10/3/12
to WebM Discussion
A couple links:

http://www.webmproject.org/docs/container/
http://git.chromium.org/gitweb/?p=webm/libwebm.git
http://git.chromium.org/gitweb/?p=webm/libvpx.git;a=blob;f=vpxenc.c

libwebm is a fully featured webm writing library that you should use
if at all possible. If not, it's at least a canonical reference for
how to do things with a webm file.

libvpx/vpxenc is much simpler, and has just enough code to write a
well formed seekable video only webm file.

The container docs describe how webm differs from mkv.
> --
> You received this message because you are subscribed to the Google Groups
> "WebM Discussion" group.
> To view this discussion on the web visit
> https://groups.google.com/a/webmproject.org/d/msg/webm-discuss/-/-tI5fN9iIeoJ.
> 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.

MS

unread,
Oct 4, 2012, 2:14:05 PM10/4/12
to webm-d...@webmproject.org
THanks John.

One thing I don't understand about the sample_muxer in libwebm is what type of file is it expecting for "input" and what type of file does it give for "output". If I want to do live streaming, then how can I modify the sample muxer?

Thanks for your help.

Frank Galligan

unread,
Oct 4, 2012, 3:40:58 PM10/4/12
to webm-d...@webmproject.org
smaple_muxer expects webm input and outputs webm.

sample_muxer has a "-live" option that will output the webm file in the format that browsers expect for live streaming. I.e. unknown segment size, unknown cluster size...


MS

unread,
Oct 4, 2012, 4:53:51 PM10/4/12
to webm-d...@webmproject.org
But what if I don't have a webm file to begin with for input? I am starting with some raw bytes and encoding them into vp8 using the vp8 SDK, and now I want to place that into the webm container. Is that not the right approach?

Ralph Giles

unread,
Oct 4, 2012, 5:54:34 PM10/4/12
to webm-d...@webmproject.org, MS
On Thu Oct 4 13:53:51 2012, MS wrote:

> But what if I don't have a webm file to begin with for input? I am
> starting with some raw bytes and encoding them into vp8 using the vp8
> SDK, and now I want to place that into the webm container. Is that not
> the right approach?

In that case, have you tried replacing the block->GetFrame() loop with
your own encoding loop? I've not used the libwebm api myself, but it
looks like you want to pass the encoded frames to
muxer_segment.AddFrame as sample_muxer does around line 469.

-r

MS

unread,
Oct 5, 2012, 12:08:18 AM10/5/12
to webm-d...@webmproject.org, MS, gi...@thaumas.net
  • I tried doing what you suggested. I have a yuv file that I put through the VP8 encoder (part of the libvpx SDK), and then each frame that I got there I am feeding into the AddFrame method. However I don't see anything when I play the resultant webm file in VLC player. For the frame.len I am feeding the size of ht frame that the VP8 SDk suggests. I am wondering what I am doing wrong.
Thanks,

John Koleszar

unread,
Oct 5, 2012, 11:55:38 AM10/5/12
to webm-d...@webmproject.org
On Thu, Oct 4, 2012 at 9:08 PM, MS <meera....@utdallas.edu> wrote:
> I tried doing what you suggested. I have a yuv file that I put through the
> VP8 encoder (part of the libvpx SDK), and then each frame that I got there I
> am feeding into the AddFrame method. However I don't see anything when I
> play the resultant webm file in VLC player. For the frame.len I am feeding
> the size of ht frame that the VP8 SDk suggests. I am wondering what I am
> doing wrong.
>
> Thanks,
>

That sounds ok in principle. mkvalidator and mkvinfo are also useful
tools to analyze a webm file. You could also try passing the webm file
to vpxdec (from libvpx) as that's got some useful error messages.

Frank Galligan

unread,
Oct 5, 2012, 12:58:25 PM10/5/12
to webm-d...@webmproject.org
Yes, that is the right approach. Maybe you should start off with smaller steps. E.g have your code output an encoded VP8 key frame over and over to your muxing code to make sure that works correctly.


MS

unread,
Oct 5, 2012, 2:30:05 PM10/5/12
to webm-d...@webmproject.org
Thanks.

One problem I am having is determining what to supply for the timecode of each frame. Could you please point me in the right direction there?

Thanks,

MS

MS

unread,
Oct 5, 2012, 3:16:17 PM10/5/12
to webm-d...@webmproject.org
Also, what is the difference between adding a video frame to a segment vs. a cluster. I noticed that if I do a (mkvmuxer::Segment) muxer_segment.AddFrame, it shows up as multiple clusters in the webm file (when I view it in mkvinfo gui). Whereas a valid webm file has multiple simple blocks in the same cluster. How do I get the latter?

Thanks,

MS

MS

unread,
Oct 6, 2012, 1:13:11 AM10/6/12
to webm-d...@webmproject.org
I have a question about simple_encode.c in the webm sample code page. When I take a .y4m file and put that into an ivf file using the encoder, and play the ivf file subsequently in VLC, I only see one really vague, multicolored screen which does not resemble the original file at all. Is that normal?

Thanks,

MS

Frank Galligan

unread,
Oct 9, 2012, 12:46:07 PM10/9/12
to webm-d...@webmproject.org
I'm not sure how you would get multiple clusters with one call to muxer_segment.AddFrame. Do you have steps to reproduce?


New clusters are usually created by adding a video key frame.

Reply all
Reply to author
Forward
0 new messages