Log in

View Full Version : Guide: How to put WMA-9 to AVI


vkem
25th March 2003, 13:37
I found a way to put Windows Media Audio 9 VBR to AVI container. You need a program named WMA2WAV and Windows Media Encoder 9 to do the trick. First, create a WAV file with HeadAC3he and put that into the encoder. Then use WMA2WAV to make the fake-wav. VirtualDub should now be able to mux that to AVI and you could watch this video for example with ZoomPlayer :)

Atamido
25th March 2003, 16:50
Why does that just sound very bad?

Oh, thats because VBR audio isn't supported in AVI. The only reason VBR MP3s work, is because of a bug in the way that the windows AVI handler works.

There isn't much reason to store WMA-9 in anything really, because even though there is support for WMV-9, there doesn't seem to be much support of the idea that WMA-9 is any better than other solutions.

Suiryc
25th March 2003, 17:38
I fear that this is not a good solution.
Althought there is a trick to put VBR audio (MP3) in AVI, this trick can't be used in a WAV file (which doesn't have the same structure).
At most the WAV file will contain the average byterate of the audio and that is what is used when the WAV file is opened by VirtualDub.
In other words you will get out-of-synch issues (the same would happen if you use programs to add a WAV header to a MP3 VBR file).

Adding a WAV header should only works (i.e. no out-of-sync issues) with CBR data.

Atamido
25th March 2003, 20:14
Well, it would play fine until you tried to seek.... Then you would be completely out of synch.

Nic
26th March 2003, 11:17
Sometimes I wish Id never created WMA2WAV ;)

-Nic

deXtoRious
26th March 2003, 19:48
If you wouldn't have done it, somebody else probably would. Besided, it's not very hard to change the PE header manually.

If MP3 allows VBR data in AVI, then why not change WMA-9 header to MP3?

Neo Neko
27th March 2003, 00:31
Originally posted by Pamel
Well, it would play fine until you tried to seek.... Then you would be completely out of synch.

I tried this stuff with Vorbis before the general awareness to the real deficiencies of AVI and the awful hacks that have been applied to it to partially supprt VBR while breaking the AVI was raised. You will never get it to work in AVI propperly. Because by the time you get done hacking any AVI parser will not be able to parse the file. Experimentation is fine. But I strongly suggest no one promotes any sort of WMA in AVI period untill Microsoft has releasd a non container locked ACM driver for it. It is just not wise at all and is responsible for many many many problems of the past. And even after all that is sed and done I will still question it's use. Because it will still cause compatability problems.

Originally posted by deXtoRious
If you wouldn't have done it, somebody else probably would. Besided, it's not very hard to change the PE header manually.

If MP3 allows VBR data in AVI, then why not change WMA-9 header to MP3?

RIFF WAV is a vanilla general container format like AVI.(Verry much so. It does not support VBR either.) MPEG headers are for MPEG streams only. It should not even remotely work me thinks.

Originally posted by Nic
Sometimes I wish Id never created WMA2WAV ;)

-Nic

You are not alone Nic. :P

This whole fixation with WMA escapes me. Maybe the problems with it's perversions in the past that have jaded me.

mf
27th March 2003, 09:27
I'm against WMA, I think it sounds bad and it's a crappy format, but one thing bothers me. What's the difference in implementation that allows VBR MP3 to be successfully hacked into AVI, but Vorbis and/or WMV not. I mean, the container doesn't really care about what format is inside a stream, does it ? Or is it a problem with the decoder ?

Nic
27th March 2003, 13:50
Its because MP3 has very certain size frames, which means with a few tricks it can be muxed into AVI, i.e. its not completely VBR, where as Vorbis and WMA are very vbr and there packets can be any size.

Avery Lee explained it once a lot better, look it up on his archived news.

Cheers,
-Nic

ps
@Neo: I know, the whole DivX Audio ;) thing made some anime/movies horrible. Enough to put anyone off, wma 9 is a step in the right direction (allowing high bitrates, 5.1 audio etc). But there are better alternatives.

Suiryc
27th March 2003, 14:10
The MP3 VBR trick only works because :
1. In DirectShow the AVI file is parsed in a way this trick is possible (but there are other ways to parse an AVI file, and those other ways won't work at all with any trick)
2. An MPEG Audio stream can be splitted in audio frames that all contains the same amount of samples (1152 samples per audio frame for MPEG1-Layer3), and the muxer will only put one audio frame per chunk in the AVI file (both are mandatory for the trick to work)

The problem with Ogg Vorbis is that data can also be splitted in Packets, _but_ all Packets doesn't necessarily contains the same amount of samples (you can find powers of 2 - 1024, 512, 256, ... - samples in a Packet), which make the MP3 trick useless.

Atamido
27th March 2003, 19:22
Hey! I was going to say that. :D

That is an excellent explanation Suiryc. Fortunately Matroska should be able to handle each of these variable bit rate and variable sample rate audio codecs fine.

If anyone would be able to help in creating a tool to transcode streams from ASF to MKV, please come to the #matroska channel. (irc://irc.corecodec.com:6667/matroska)

deXtoRious
28th March 2003, 20:36
This whole Matroska thing has gotten me pretty excited. When is it going to be available??

Atamido
28th March 2003, 20:54
That depends largely on when myFUN gets the directshow filter working.

deXtoRious
29th March 2003, 15:58
Is there any release date or something?

ChristianHJW
30th March 2003, 02:22
Originally posted by deXtoRious Is there any release date or something?

Yes, there is a release date. Its just that nobody knows when that will be ;) .... the current existing DShow filter is so far away from a possible release, i sincerely hope myFUN will find more time to work on it in the near future, or we'll be in serious trouble .... just imagine matroska files can be played in mplayer, VLC, Xine and Gstreamer but not on Windows :( ....

deXtoRious
30th March 2003, 19:20
just imagine matroska files can be played in mplayer, VLC, Xine and Gstreamer but not on Windows ....

But does it work on Linux?

spyder
31st March 2003, 22:55
It works to an extent in Linux. But a few more advanced features of the container are still unsupported anywhere. Mosu has some very nice code for muxing.

I can play xvid+vorbis matroska files in mplayer :P