The new file would comprise a single segment synthesized from the
clusters in the segments of the original files.
> According to the Matroska specification, I know a live stream is
> designated by setting the “Segment” size to “unknown”.
Right, a value of -1 (you can use a single byte for this).
You can also set each cluster size to -1.
> I manually set
> the size of each segment to a very large value and setting the
> duration of the segments to 100 hours.
This might break parsers that compare the file size to the size
reported by the segment. If the segment size is larger than the file
size, a parser might assume that the file has been truncated and
refuse to parse it.
If you don't know the segment size a priori, and you are writing to an
output media that is non-seekable, then just set the segment size to
"unknown" (-1).
> And I also delete the
> “SeekHead” elements and “Cues” elements in 2 mkv files.
Right, they aren't needed.
> I have no
> cluster in the webm files.
I don't know what this means. You must have at least one cluster.
> But only the 1st segment in the final file can only played well by VLC
> and web browser. I want to know what is the problem?
You cannot simply concatenate the files. If you do that, the most
likely behavior is that a parser will render the first segment in the
file, and ignore the others.
It might be the case that some parsers are very liberal in what they
accept, and, noticing that an EBML header and Segment elements follow
the end of the first Segment (instead of reaching EOF, which is
canonical), and guess that this complex file is the concatenation of
simpler files, but you should not assume this.
I have a simple program that concatenates WebM files. I can include
it among the libwebm sources, if you like. If you're interested, file
a bug report requesting that a "webm concatenation program" be
included among the samples in the libwebm project, and assign the bug
report to me.
-Matt