Log in

View Full Version : Muxing "new" AudioFormats (AAC, WMA9) into OGM and Matroska!


bond
11th July 2003, 14:30
i always thought that it wasnt possible to mux aac into .ogm but now i tried it for myself (which seems to be always a good idea ;) ) with tobias's ogm multiplexer in graphedit and what happens :eek:

it works!
for both stereo and multichannel files...

input was in both cases a .mp4 file (splitted with 3ivx)

playback is fine with coreaac

although ogm seems to have a slightly bigger overhead with stereo files and a even more bigger one with multichannel than .mp4 and .mkv

edit: just changed subject name

ChristianHJW
11th July 2003, 16:46
Originally posted by bond although ogm seems to have a slightly bigger overhead with stereo files and a even more bigger one with multichannel than .mp4 and .mkv ... maybe because no lacing is used ?? Just guessing ...

bond
17th July 2003, 01:07
read more about about muxing aac here (http://forum.doom9.org/showthread.php?s=&threadid=57217&perpage=20&pagenumber=2)!

bond
17th July 2003, 01:15
now i also tried similar things with wma9 pro:

i muxed .wma (wma9 pro - get the sample here (http://download.microsoft.com/download/winmediatech40/Utility/1.0/W98NT42KMeXP/EN-US/6channel.exe)) content into .avi (using graphedit and "avi mux" (qcap.dll)), into matroska (using gabest's muxer) and finally also into .ogm (using tobias' ogm multiplexer) and it worked in all three cases!
the sound is decoded by a m$ filter called "wmaudio decoder dmo" without a problem it seems...

hm it seems also to work with wma9 standard codec

of course i didnt encode a movie or so with wma, so i cant say if there are sync issues...

Dark-Cracker
17th July 2003, 12:32
hum i have try with .aac (using file asynch filter) and without success for the matroska/ogm mux.
i have made a headerless file and also tested with "3Divx D4 Media Splitter" filter. it must be an .mp4 file ?

Ps: any idear for an .ac3 mux (tested with "DTS/AC3 source" filter from gabest but without success)?

Bye.

Animaniac
17th July 2003, 12:35
I thought we knew this for some time now... >.<

AAC in OGM/Matroska is successful when mu'xing the raw stream into an MP4 and then using 3ivx to demu'x in the filter graph.

Nic
17th July 2003, 12:41
My muxer for OGM will be about soon. I modded cyrius' OGMuxer code to take AAC. Seems to work well, didn't notice any noticeable overhead. Ill test tonight and report back :)

bond
17th July 2003, 12:56
Originally posted by Animaniac
I thought we knew this for some time now...to my knowledge it was always said that muxing wma9 in non wma containers isnt possible

JohnV
17th July 2003, 18:09
How's OGM's SSA support with UTF-8 subs?
Does "ä,ö" and other language specific characters work ok with it?

I've been testing Matroska, and managed to create nice working MPEG4 video+AAC-audio+UTF-8 SSA stream, which works nicely in MPC.
Personally I'm just starting to experiment with the new containers, but my feeling is that Matroska has more developers working with it more eagerly (Been spending some time at #matroska). My impression is that OGM seems to be pretty much one man's project which was previously not appreciated at all by Xiph. Considering how slowly generally things are going on in Xiph (which may or may not mirror to the future OGM development/support), I'm supporting much more happily the eager and friendly developers of Matroska.. :)

spyder
17th July 2003, 22:38
@Nic, Koepi

I have a few questions about Ogg support for multiple types of media streams. I don't want this to turn into yet another battle. These are serious questions that need a serious answer.

1) Who is making this standard? Xiph or someone else? I would hate to see a repition of the whole "OGM is not Ogg" scenario.

2) How will you handle B-frames in Ogg? Will you just use the VfW way?

3) I don't recall that Ogg allows overlapping packets. How will you support subtitles that overlap in time?


Spyder

PS: Also, where can I find an official spec for all of this?

Nic
17th July 2003, 22:51
1) well Xiph (AFAIK) are going to build up there ogg library to make it easier to write the files. I know Xiph have discussed with others about the total re-write of Ogg DirectShow Filters. But im not sure much I can say about that...

2) For now yes. :) starting off small, before we start worrying about the "right" way to do things.

3) That ones going to be tricky ;) But ill look into that, and get back to you.

@all:
Look, we could fight about which is better or not. In my opinion, matroska should end up better. But im going to work with OGM, purely for fun and to see where I can get it too. I can't work in the "ChristianHJW team" that exists around matroska...it really doesn't fit me. Alot of people still like OGM alot, and still use it. And there is still alot of support for it in apps (videolan, etc). Its also a very simple container in essence, which I also like. So I think it deserves support. And thats what im doing :)

It isn't a fight and it isn't a competition. Lets just see where it ends and keep things friendly. If things get out of hand again, ill have the thread closed.

Take Care,
-Nic

ChristianHJW
17th July 2003, 23:25
Originally posted by Nic I can't work in the "ChristianHJW team" that exists around matroska...it really doesn't fit me.

What team ? .... you're talking about this bunch of mad guys on #matroska :P ? .... well, i thought you'd fit very well, but maybe you are much more sane than i thought, too sane :D ..... anyhow, contributing to matroska doesnt necessarily mean to become a fixed team member, Gabest is showing this most effectively. He refuses to be officially counted to the crazy group of people he sees behaving like mad men on IRC every day, still he's there 24/7, gets all the info's he needs/wnats and is contributing a lot more than some of the so-called 'core-devs' ;) .....

However, i personally dont understand why you are interested in developing OGM, but i may be biased here, at least a bit :D. In any case, best of luck .... and if you ever feel OGM isnt what you want to anymore, we could really urgently need a new man developing the 'official' parser filter such that it can half way cope with Gabest' great filters ;) ....

Nic
17th July 2003, 23:33
@Chris: LoL. I meant it didn't fit me because I can't work in a team right now, because then you guys would need to rely on me to finish something.....Me? Finish a project? You must be crazzzzy ;)
Gabest is hardcore. Simple as that. ;)

Anyway lets get this thread back on topic; Hopefully AAC SBR playback will be FAAD2 soon so that CoreAAC can be built using it. and muxing it into matroska/ogm will be just as easy. HE AAC is something to look forward to, heard nothing but good things about that format.

-Nic

JohnV
18th July 2003, 00:00
Originally posted by Nic
Anyway lets get this thread back on topic; Hopefully AAC SBR playback will be FAAD2 soon so that CoreAAC can be built using it. and muxing it into matroska/ogm will be just as easy. HE AAC is something to look forward to, heard nothing but good things about that format.

-Nic [/B] Only worry I have is that HE AAC multichannel requires some more processing power. Though Menno hasn't made any SSE2 or 3DNOW optimizations which would definitely help.

Could be that the SBR code in FAAD2 will become available at the earliest on Tuesday, when Menno gets back from his holiday, unless he can handle it from his holiday location. But there's also the new licence issue of FAAD2.. We wont see it before that issue is cleared.

I hope they had time to include one surprise and very wanted and useful feature for the Ahead MPEG4-AAC codec and FAAD2 which Menno implemented on Monday.. ;) Well, if not, it will be there soon.. The new feature begins with "g". :) It's also something which may concern the Matroska and OGM developers, if they wanna take the absolute full advantage of Ahead MPEG4-AAC/HE.

Koepi
18th July 2003, 00:42
I dislike the idea to have yet some other 3rd party filters involved for using graphedit/directshow to mux aac into OGM. You even need to create an mpeg4 file for having that aac soundtrack.
The OggDS filters are generally working simple: if you can _split_ something within directshow to send it to the appropiate decoders, you can mux it into OGM without problems.
So "all we need" is an (opensource,) free splitter for:
a) AAC (with headers,...) delivering a raw bitstream
b) mpeg+aac, delivering a raw bitstream

and we're settled with that. I hope Nic's code can be adopted to create a DSF for OggDS which exactly does that.

If we achieve this, OggMux can directly handle any AAC file as well. I don't like the idea to add a hack which requires inserting of the 3div splitter to a DSF graph.

Regards
Koepi

Nic
18th July 2003, 08:23
@Koepi: Ill write a AAC source filter over the weekend, should only take a very short amount of time. At present I mux AAC without the ADTS headers into OGM and add a 2 byte codec initialisation after the WAVEFORMATEX/stream_header (which is necessary for coreaac/faad).

Although it might be an idea to make it so that coreaac can also accept a single adts/adif frame after the waveformatex header and detect that and use that also to decode aac with headers....Hmmmm. Ill ask Toff :)

-Nic

Koepi
18th July 2003, 08:26
Overlapping timecodes might be unnecessary if you use future color-flags for example. If you really need overlapping, but not parallel subs this doesn't work of course.

The subtitle filter must cache up all the subtitles in that case before starting the playback, bring the subtitles in correct order and then needs to work through the list, always looking i.e. 10 subtitles ahead to see if there are some which have to be shown at the same time. Shouldn't be too hard, but playback will severely suffer from that.
Or scan all the subs before mux'ing and find the overlapping timecodes. Write a TAG into the overlapping subtitles like "<overlapping>" which instructs the subtitle reader to fetch the next subtitles (which can have that TAG as well...). Sounds like the simplier version.
Just some ideas.

What's the difference between SSA and STR subs btw.? I don't use subtitles (or very seldom, like in Rush Hour 2 - and there I burn them in ;) ) so I need input from you guys who want support for special features - the filters do already everything I need, so you must help as well please :)

regards
Koepi

Koepi
18th July 2003, 08:28
Cool, thank you Nic,

that will help to make the format simpler usable. I think we should include that as "run time" filter into the OggDS sources so that there is no need to install even more filters. Of course a seperate version should be offered, but I like to keep things as simple as possible.

:-)

Best regards
Koepi

alexnoe
18th July 2003, 08:54
SRT is simpler. It does not contain font, color, size information and stuff like that. It's just a bunch of lines of text and timing information.

SSA can contain several "styles", describing a font with font face, color, size, border etc. Each subtitle element can have a different style, so that changing the font is possible.

Koepi
18th July 2003, 09:28
SRT is simpler. It does not contain font, color, size information and stuff like that. It's just a bunch of lines of text and timing information.

SSA can contain several "styles", describing a font with font face, color, size, border etc. Each subtitle element can have a different style, so that changing the font is possible.

So it's no problem to extend the SubTitDS muxer (which source we don't have! We need a different subtitle muxer...) to support SSA as it would just mean to support more TAGs, it sounds to me as if we're talking about html-subtitles.

My suggestions above for proper overlapping timecodes still have to be implemented as well within the subtitle filter. I guess using gabest's filters (manually in graphedit) doesn't work yet?

Someone with more insights to subtitles may want to explain how things currently work (i.e. within avi) to see if that concept is portable.

Thanks for your help,

regards
Koepi

EDIT: I edited this thread, removing all the off-topics.

Doom9
18th July 2003, 13:20
I'm wondering, what do you need overlapping subs for?
The DVD authoring programs I use are very strict about this and will absolutely refuse to compile anything as displaying two subs at the same time isn't possible and imho wouldn't make much sense either.

ChristianHJW
18th July 2003, 14:04
Originally posted by Doom9 I'm wondering, what do you need overlapping subs for?

SSA specs clearly allow them. If you cant handle overlapping subs, you cant handle all existing SSA subs. In matroska we have added a new feature called 'timeslice' to support this, as our specs disallow to have blocks with overlapping timecode also ....

EDIT :

Not that anybody here would care, but big thanks to Pamel for pointing out to me that i was posting BS, of course it was the block duration element that is used to make overlapping subs possible, while timeslicing is used to be able to find out the timecode of a laced block without having to decode all other frames in the lace ...

unmei
18th July 2003, 16:56
the use of overlapping subs ?
ie
-cast/credit listings while karaoke is running
-labels translating visual text (street signs, annotations..) while people are talking

there sure are more applications, but these 2 are the one most obvious to me. I love SSA for this possibility (OT: but also for other great features)

Doom9
18th July 2003, 18:10
cast/credit listings while karaoke is runningI've never seen a movie that had the credits as subtitles.

As for the other one, sounds a little pulled by the hair as well. As I said, DVDs don't have it, so movies can do without them (I've also never seen overlapping subs in movie theatres and all movies in my country are subbed - or at least a majority of them..)

bill_baroud
18th July 2003, 21:03
@doom9 : you never watched a 'fansub' then. By credits, unmei is talking about who translated the movie, who timed the script etc ... not the credits of the movie itself :D
and fansubbers like a lot to do some useless-but-indispensable fancy effects, allowed by the new revision of SSA, Advanced SSA.


@Koepi : for AVI, SSA file is just copied as-is somewhere in a text stream with "GAB2" (i think) at the begining, so when the graph is rendered, Vsfilter render every text stream starting by "GAB2". It doesn't allow any edition (cutting) afterwards, and shouldn't be used.

For matroska is a little more tricky, it copy SSA headers (styles, scripts infos etc...) in the CodecPrivate section, and each events is putted in a block, which have timestamp etc. Overlapping give me headache and i didn't found a solution, you have to ask Gabest to know how he did that, i think he explained it but i don't remember, sorry ^^;

i'm just talking about SSA here.

Ah yeah, for the ones who are asking for png subs, i remember Cyrius trying it and it was too slow to decompress for a real-time application... well i think we were talking about animation with png, but even just one png could freeze the video.

[edit] errrrm, alexnoe just pointed me out that AviMux can edit Avi with ssa file ... it's still muxed like that but he's rebuilding SSA file after each change ( he's crazy ^^ )

Atamido
19th July 2003, 08:05
For more information about storing SSA/ASS in Matroska, please read the specs page (http://matroska.free.fr/specs/subtitles/ssa.html) devoted specifically to that.

HomiE FR
19th July 2003, 09:52
@Pamel: Sorry but I believe that there is something wrong on this page (http://matroska.free.fr/specs/subtitles/ssa.html).

"[Pictures]" or "[Fonts]" part can be found in some SSA file, they contains UUE-encoded pictures/font but those features are only used by Sub Station Alpha, i.e. no filter (Vobsub/Avery Lee Subtiler filter) use them.

VobSub (at least since 2.25) can handle at least embedded fonts in ASS scripts (I didn't try embedded pictures yet), I tried it a week ago and it worked. Moreover I think that this can be a really interesting feature, because it makes subtitles playback the same everywhere, even if people don't have the fonts installed. :) It could make hard subbing more useless, even for fansubs (if you have enough CPU power that is).

That's why I'd like to see it possible in Matroska (gabest told me that SubtitleSource currently discards the "[Fonts]" parts when it parses the script, so we can't use embedded fonts for scripts embedded in Matroska files). I'm waiting for some news from gabest about the topic (I'm sure he'll be able to do it when he'll have time and motivation for this secondary-but-necessary feature).

bill_baroud
19th July 2003, 15:00
well it's me who written those specs, and it's mainly based on my own experience playing with SSA. I say that because it worked only one time for me. When i sended the script to a friends it didn't worked for him, and wouldn't re-work for me too ... so i assumed that embedded fonts support was unstable and not to use now.
And it's very sad, because, like you, i would love to have embedded fonts in my script. I don't think it will use more CPU power, what's use CPU is rendering effects ;)

For support in Matroska, i don't think Gabest will had hard time with it ;), you just have to copy those part in the CodecPrivate header but i suppose he focused on a working filter before trying some fancy options ;)

HomiE FR
19th July 2003, 15:20
bill_baroud: Great! :) I'm looking forward to it. When I talked about CPU power I was thinking about all the effects used by fansubbers for their subtitles (move, rotate, karaoke, layers...).
So I guess we all have to wait for an update from gabest. But like you said, this is obviously not a main feature. I'll try to be patient. ;)

bill_baroud
19th July 2003, 16:20
that's completly OT but, don't expect anything about CPU power for effect in Dvobsub ... i already give some torture script to Gabest, but he doesn't think it's possible to optimize the rendering in the state it is. It would need a complete rewrite and If you can learn Opengl/DX9 programming, you could perhaps use modern GPU functions to help rendering (a la Mac Os X ;) ) but it's not in Gabest's Plans...

unmei
20th July 2003, 16:07
oki, i have my impression of AAC in mkv : it works damn great!

All players i have (except QT and RealOne of course) play the file without problems. Startup time and seek time even seems to be quite a bit lower than with Ogg vorbis - i can jump from 17:30 to 05:00 (mm:ss) with the file over the network and usually i cannot feel any delay at all (with other, say vorbis, encodes it often is stuck for maybe 1/3 sec). My initial fear AAC would eat my CPU and not leave enough power for the video decode turned out unnecessary, it seems not to eat more power than vorbis.

I used nero to make on of those 50 demo AAC encodes and 3vix DSF to feed it (being a mp4)in graphedit to the MatroskaMuxer. For playback the CoreAAC filter gets used and poses not problems. The AAC is ~64kbit/s stereo LowComplexity. The bitrate is a bit at the low end i guess i'll go for 80-96 kbit/s in future but as things look now AAC is a considerable alternative (what greatness do we have to expect from HE-AAC then, as normal AAC already performs so good :)

bond
20th July 2003, 17:16
@64kbps vorbis is still better than normal aac but he-aac should be much, much, much better than old aac