I have a couple of ogg vorbis files, all encoded with the exact same properties that I want to concatenate into a single file.
I know that the ogg vorbis format supports plain concatenation of multiple files like:
$ cat file1.ogg file2.ogg > output.ogg
But sadly not all players are able to understand files created like that, for example my mobile audio player and I'd avoid to buy a new one. Other programs which don't understand it are gstreamer. That method also does not work if the input ogg files happen to all have the same stream id.
Additionally, since I'd like to throw away the original files and only keep the concatenated version, I'd like the concatenation to be done lossless, just as the
I also want to avoid concatenating the files into a lossless format like flac as this would unnecessarily blow up the file size. If that would be okay, then I could keep the original ogg files and would use less space.
It seems that ffmpeg can sometimes do it using the concat demuxer:
$ cat inputs.txt file 'in1.ogg' file 'in2.ogg' $ ffmpeg -f concat -i inputs.txt -c copy out.ogg
If I look at the raw hexdump of my input files, then I can find the vorbis packets exactly represented in the output file. So I guess really no re-encoding happens.
But this does not seem to work on all input files. Sometimes (not sure what triggers this), ffmpeg would give the warning:
Non-monotonous DTS in output stream 0:0; previous: 5011328, current: 5011200; changing to 5011329. This may result in incorrect timestamps in the output file.
And then I would hear a very faint "gap" between two files. Thus this certainly is not a global solution.
Since I couldn't find one I tried to write my own tool in this stackoverflow question.
Is there a way to concatenate multiple ogg vorbis files but without re-encoding them and with only a single stream per output? Which tool is able to do that job?