3

we're using mkvmerge to concat user uploaded audio into a single file (this is all done from code in a django website).

The command line looks like mkvmerge -o /path/to/output.webm -w /file/to/concat1.oga + /file/to/concat2.oga (there can be hundreds of files, but that's not the issue).

It usually works well, except with a couple files, and we're trying to figure out the problem with these, so we can improve our code.

The error we get is: Error: The track number 0 from the file '/path/to/file1.oga' cannot be appended to the track number 0 from the file '/path/to/file2.oga'. The formats do not match.

The two files are valid ogg/vorbis files, as shown by the output of ogginfo:

Processing file "/path/to/file1.oga"...

New logical stream (#1, serial: 32b21854): type vorbis
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: Xiph.Org libVorbis I 20101101 (Schaufenugget)
Channels: 1
Rate: 22050

Nominal bitrate: 45.111000 kb/s
Upper bitrate not set
Lower bitrate not set
User comments section follows...
    ENCODER=libsndfile
    TITLE=Tape1
Vorbis stream 1:
    Total data length: 8453 bytes
    Playback length: 0m:01.532s
    Average bitrate: 44.126101 kb/s
Logical stream 1 ended

and ogginfo /path/to/file2.oga gives me:

Processing file "/path/to/file2.oga"...

New logical stream (#1, serial: 46c1e760): type vorbis
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: Xiph.Org libVorbis I 20101101 (Schaufenugget)
Channels: 1
Rate: 22050

Nominal bitrate: 58.000000 kb/s
Upper bitrate not set
Lower bitrate not set
User comments section follows...
    TITLE=Tape2
Vorbis stream 1:
    Total data length: 12121 bytes
    Playback length: 0m:01.787s
    Average bitrate: 54.234588 kb/s
Logical stream 1 ended

The only difference I can see is the bitrate, which from my understanding of the vorbis format, should not be an issue.

Any ideas on what the issue can be?

1

1 Answer 1

2

Here's a solution to the problem, if anyone is interested.

The problem is that webm format seems to be more picky than matroska with respect to the vorbis stream it can contain. Documentation is virtually impossible to find about this (even the official webm specs only hint that there are constraints on the bitrate, http://www.webmproject.org/code/specs/container/#demuxer-and-muxer-guidelines).

But the source code of mkvmerge actually mentions that "The Vorbis codebooks are different; such tracks cannot be concatenated without reencoding" in the case of my files. (grep for the above quoted string in the source for more details)

So that answers the question: I must reencode the whole thing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .