Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th October 2012, 15:33   #1  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Mux raw vorbis audio to Ogg?

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.
Guest is offline   Reply With Quote
Old 7th October 2012, 18:51   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Tool, I don't know. Maybe oggmerge?

But of course there is libogg, which should provide the required code for ogg muxing. Also you might look at oggenc2 and/or libvorbis(file) on how to feed it with Vorbis data.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 7th October 2012 at 18:56.
LoRd_MuldeR is offline   Reply With Quote
Old 7th October 2012, 19:13   #3  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Thanks, but nothing useful there for my task. I'm going to have to write one myself it appears.
Guest is offline   Reply With Quote
Old 7th October 2012, 19:52   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
ffmpeg might also be able to mux to ogg,..
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 8th October 2012, 14:41   #5  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
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.

Last edited by Guest; 8th October 2012 at 14:50.
Guest is offline   Reply With Quote
Old 8th October 2012, 14:49   #6  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
You still might use libogg for the Ogg muxing part, I suppose.... (it has a BSD-style license)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 8th October 2012, 14:54   #7  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
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!

Last edited by Guest; 8th October 2012 at 15:18.
Guest is offline   Reply With Quote
Old 9th October 2012, 05:45   #8  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
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 is offline   Reply With Quote
Old 9th October 2012, 07:24   #9  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
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!
Guest is offline   Reply With Quote
Old 9th October 2012, 09:35   #10  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
you may also have a look at the mkvtoolnix sources...mkvextract tool is able to extract vorbis streams from mkv to ogg.
Kurtnoise is offline   Reply With Quote
Old 9th October 2012, 14:26   #11  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
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.
Guest is offline   Reply With Quote
Old 9th October 2012, 14:53   #12  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
H.264 with multiple Vorbis streams in MKV:
http://samples.libav.org/Matroska/vo...dio-switch.mkv

Another one with MPEG-4 ASP + Vorbis + Subtitles:
http://www.bunkus.org/videotools/mkv...orbis-subs.mkv
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 9th October 2012 at 15:15. Reason: Correction of info for 2nd file
LoRd_MuldeR is offline   Reply With Quote
Old 9th October 2012, 15:09   #13  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
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.
Guest is offline   Reply With Quote
Old 9th October 2012, 17:51   #14  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Here a little sample with AVC@200Kbps+6ChVorbis@160Kbps in .MKV: http://www.sendspace.com/file/6wqw32

Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 9th October 2012, 18:01   #15  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Thanks, SMD! Six channels is something I definitely need to test.
Guest is offline   Reply With Quote
Old 9th October 2012, 18:47   #16  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Working fine for 6 channels.
Guest is offline   Reply With Quote
Old 9th October 2012, 18:56   #17  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by neuron2 View Post
Working fine for 6 channels.
Nice one...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 9th October 2012, 20:19   #18  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
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.
Guest is offline   Reply With Quote
Old 9th October 2012, 20:49   #19  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
I've just tried the link offered within this topic (for 2043) but it does not appear to be working
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 9th October 2012, 21:12   #20  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
I think that is some older "candidate" version. Just graph the latest release from here:
http://neuron2.net/dgdecnv/dgdecnv.html
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.