Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
The original error report is at code.ductus.us/ticket/127#comment:4 along with a copy of the files, if you feel like reproducing. –  Laurent S May 20 '12 at 18:49
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.