Hi. Tom and All
Thanks for your kind and detailed explanation. After carefully reading
your comment, although webmlive is working prototype with limitation
and depedency on directshow, I think I can use some of webmlive
classes for my project. Since I need a webm parser to buffer, not
file, I did little modification and added "WebmBufferParser" and
"WebmBufferReader" class to my project code; mostly about "access
specifier" classes and pointer to keep track of segment, tracks and so
on.
the following is my approach
webmlive::WebmBufferParser videoBufferParser;
webmlive::WebmBufferWriter writer; // curretnly abstract class object.
while(1) {
....
/* get vorbis encoded data from real-time buffer */
....
/* get vpx encoded data from real-time buffer */
getVideoStreamBuf( &retPtrToVideo, &videoLength);
if (retPtrToVideo ) {
for( int i =0; i < videoLength; ++i)
videoBuffer.push_back( (uint8)retPtrToVideo[i] );
if ( retPtrToVideo )
videoBufferParser.Parse( videoBuffer, &videoLength );
... // some other codes to related to muxing.
... // I also added buffer deletion function. but currently commented
out to look into "Parse"
}
while I walk through the code, it looks that key processes about
"Parse" function can be described in the following
1. SetBufferWindow(&buf[0], buf.size(), total_bytes_parsed_)
2. WebmBufferParser::ParseSegmentHeaders(int32* ptr_element_size)
3. WebmBufferParser::ParseCluster(int32* ptr_element_size) {
...
status = segment_->LoadCluster(current_pos, length);
if (status) {
return kNeedMoreData; // returns all the time although new
cluster starts again
}
...
}
"Segment::LoadCluster" function invokes "Segment::DoLoadCluster". The
function returns non-zero value all the time along with my code.
While I am reading "DoLoadCluster" function, there is commented out
code "~~~ to support live webm" and it keeps returing
"E_FILE_FORMAT_INVALID" although my code generates new cluster every
33 seconds [webm mux guideline]. The file dumped from the buffer play
well in VLC player even though it does not carry the size of segment
for live webm.
long Segment::DoLoadCluster(
long long& pos,
long& len)
{
...
#if 0 //we must handle this to support live webm
if (size == unknown_size)
return E_FILE_FORMAT_INVALID; //TODO: allow this
#endif
...
if (id != 0x0F43B675) //Cluster ID
{
if (size == unknown_size)
return E_FILE_FORMAT_INVALID; //TODO: liberalize
m_pos = pos + size; //consume payload
continue;
}
...
}
I am very curious with what I have missed and if I still can continue
in this approach. any comment will be welcome and appreciated.
On Aug 8, 11:38 pm, Tom Finegan <
tomfine...@google.com> wrote:
> The v2 branch of webmlive can be used as an example of live vp8/vorbis
> encoding, but the final patch for audio support hasn't landed yet (and
> won't in the near future, because I've been working on other projects).
>
> In brief, webmlive works like this:
>
> 1) DirectShow feeds uncompressed audio and video samples to the audio and
> video sink filters.
> 2) The a/v sink filters push data into buffer pool objects.
> 3) The a/v encode thread pulls data from the buffer pools, encodes the data
> using libvpx and libvorbis, and feeds the compressed samples to libwebm.
> 4) (still in the encode thread) When a cluster is completed, the encode
> thread hands the completed cluster off to a data sink interface attached to
> a HTTP uploader that runs in another thread.
>
> webmlive v2 gitweb:
http://git.chromium.org/gitweb/?p=webm/webmlive.git;a=shortlog;h=refs...
>
> audio encoding patchset (still under review, not perfect):
https://gerrit.chromium.org/gerrit/#/c/22771/
>
> On the other hand, the master branch contains a working live encoding
> example. I wouldn't use that, though. It's a prototype version that relies
> completely on DirectShow, and uses a file reader object to read data
> written to disk after encode/mux/writing to disk takes place within the
> DirectShow filter graph.
>
> On Wed, Aug 8, 2012 at 7:06 AM, Hyoung joon Jun <
hi.jo...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I mean more likely muxing vorbis/vpx encoded data dynamically in real time
> > on the buffer. is there any suggested starting point I can approach for
> > that ?
>
> > Thanks & regards
> > joon
>
> > On Wed, Aug 8, 2012 at 9:21 PM, Oleksij Rempel <
lexa.fis...@gmail.com>wrote:
>
> >> What do you mean with dynamic muxing?
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "WebM Discussion" group.
> >> To post to this group, send email to
webm-disc...@webmproject.org.
> >> To unsubscribe from this group, send email to
> >>
webm-discuss+unsubscr...@webmproject.org.
> > *Thank you
> > Best regards
> > joon
> > *
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "WebM Discussion" group.
> > To post to this group, send email to
webm-disc...@webmproject.org.
> > To unsubscribe from this group, send email to
> >
webm-discuss+unsubscr...@webmproject.org.