View Full Version : Mux raw vorbis audio to Ogg?
Guest
7th October 2012, 15:33
I have a raw Vorbis audio packet stream. I need to put it into an Ogg container. Does anyone know of tools or code that will do that? Thank you.
LoRd_MuldeR
7th October 2012, 18:51
Tool, I don't know. Maybe oggmerge (http://svn.xiph.org/trunk/ogg-tools/oggmerge/)?
But of course there is libogg (http://git.xiph.org/?p=mirrors/ogg.git;a=tree), which should provide the required code for ogg muxing. Also you might look at oggenc2 (http://www.rarewares.org/files/ogg/oggenc2.87srcs.zip) and/or libvorbis(file) (http://git.xiph.org/?p=mirrors/vorbis.git;a=tree) on how to feed it with Vorbis data.
Guest
7th October 2012, 19:13
Thanks, but nothing useful there for my task. I'm going to have to write one myself it appears.
Selur
7th October 2012, 19:52
ffmpeg might also be able to mux to ogg,..
Guest
8th October 2012, 14:41
Thanks, guys, for the suggestions. I've figured out what I needed to know from a careful reading of the specs and looking at what the Matroska parser in DGIndexNV actually delivers when attempting to demux an A_VORBIS stream. I needed to know how to get the vorbis packet boundaries so that the Ogg pages could be properly created for output. In fact, with a raw vorbis bitstream the only way to know the packet boundaries is by fully decoding the stream. I am trying to add to DGIndexNV the capability to demux A_VORBIS from MKV into an Ogg container. What I have found is that the packets are stored one per "frame" in the MKV (i.e., each call to mkv_ReadFrame() returns one audio packet), which makes it really easy to know the packet boundaries. :) I was fooled at first because I saw 1-byte frames and thought they can't be packets but in fact such tiny packets are typical in vorbis.
Of course for DGDecNV I have to write my own code so I prefer not to even look at FFMPEG code. I do know from experimenting and the considerations above that it cannot mux raw vorbis but only when demuxing from another container.
LoRd_MuldeR
8th October 2012, 14:49
You still might use libogg for the Ogg muxing part, I suppose.... (it has a BSD-style license)
Guest
8th October 2012, 14:54
Perhaps, but with the full understanding the code is now rather simple to write and I don't need the whole of libogg. Still, it may have some useful tricks so I'll take a closer look at their implementation. Thanks for the suggestion.
EDIT: On looking I see that if nothing else I can certainly grab their CRC32 code. :)
EDIT2: Hmmm, maybe I can use it in its entirety.
EDIT3: Actually, it's just what I need. Thanks LoRd_MuldeR! :thanks:
Guest
9th October 2012, 05:45
Oh man, did I just get a kick in the patootie!
Everything was going great with libogg until it came time to write the granule positions. Hmm, what to do? Seems we need to know the blocksize of all the vorbis packets, so now I need to parse the vorbis audio packets themselves, possibly with libvorbis which would be overkill, or writing something myself. Now I understand why a lot of people do not like the Xiph stuff.
Guest
9th October 2012, 07:24
Well golly gee, it only took a couple hours to incorporate libvorbis and decode the block sizes. Now I am writing the granule positions properly and have succeeded to demux playable ogg audio files from MKV!
Kurtnoise
9th October 2012, 09:35
you may also have a look at the mkvtoolnix sources...mkvextract tool is able to extract vorbis streams from mkv to ogg.
Guest
9th October 2012, 14:26
Thanks, Kurtnoise. I already had looked at it and that's how I knew to use libvorbis to get the block sizes. :)
I'm looking for MKV samples with vorbis audio now for testing, so if anybody has any they can provide it would be very helpful.
LoRd_MuldeR
9th October 2012, 14:53
H.264 with multiple Vorbis streams in MKV:
http://samples.libav.org/Matroska/vorbis-audio-switch.mkv
Another one with MPEG-4 ASP + Vorbis + Subtitles:
http://www.bunkus.org/videotools/mkvtoolnix/samples/vsshort-vorbis-subs.mkv
Guest
9th October 2012, 15:09
Thanks! That first sample is really great. The second however is actually MPEG4 ASP, which I can't load in DGIndexNV.
I think I have enough to release this now.
SeeMoreDigital
9th October 2012, 17:51
Here a little sample with AVC@200Kbps+6ChVorbis@160Kbps in .MKV: http://www.sendspace.com/file/6wqw32
Cheers
Guest
9th October 2012, 18:01
Thanks, SMD! Six channels is something I definitely need to test.
Guest
9th October 2012, 18:47
Working fine for 6 channels. :D
SeeMoreDigital
9th October 2012, 18:56
Working fine for 6 channels. :D
Nice one...
Guest
9th October 2012, 20:19
I slipstreamed it into 2043 that you can redownload if you'd like to do further testing. Also fixed a regression in the Info dialog and added a few other minor features.
SeeMoreDigital
9th October 2012, 20:49
I've just tried the link offered within this (http://forum.doom9.org/showthread.php?t=165970) topic (for 2043) but it does not appear to be working :scared:
LoRd_MuldeR
9th October 2012, 21:12
I think that is some older "candidate" version. Just graph the latest release from here:
http://neuron2.net/dgdecnv/dgdecnv.html
SeeMoreDigital
9th October 2012, 21:36
Thanks for the link...
I must admit I have not tried any versions of DGDecNV as until recently I did not have a computer with an nVidia GPU...
Guest
9th October 2012, 23:06
If you don't have a license I'll give you a free one, SMD.
SeeMoreDigital
10th October 2012, 09:36
If you don't have a license I'll give you a free one, SMD.I'd like that very much. Many thanks :D
I'm off to work now, with a spring in my step...
Guest
10th October 2012, 12:42
I've sent one to the email associated with your account here. Advise me if you don't get it.
SeeMoreDigital
10th October 2012, 16:59
I've sent one to the email associated with your account here. Advise me if you don't get it.
I'm happy to report the registration process went fine...
I quickly tried your 2043 build with some .OGG file muxes, along with some .MPG, .TS, .M2TS, .AVI and .MKV muxes. And all appears to be working well.
I really like that the single step option lets me know the frame structure type too ;)
Many thanks again.
Guest
10th October 2012, 17:18
I quickly tried your 2043 build with some .OGG file muxes Not sure what you mean by that, as DGDecNV cannot open Ogg files.
SeeMoreDigital
10th October 2012, 17:29
Not sure what you mean by that, as DGDecNV cannot open Ogg files.
My mistake. I had too many files on my desktop. It was of-course the 6Ch Vorbis audio file I de-muxed out of the .MKV container :eek:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.