View Full Version : [SOLVED] MPlayer: no support for Speex audio in AVI files?
Midzuki
11th March 2010, 07:23
A couple of days ago, I created an AVI file containing WMV3 and Speex. The audio plays fine in VirtualDub, WMP and MPC, but not in MPlayer, which says:
Cannot find codec for audio format 0xA109
even when there is a "speex32.acm" in its "codecs" folder. :confused:
Apparently it detects and plays Speex audio in Ogg files only.
*THUMBS DOWN*
roozhou
11th March 2010, 15:10
AFAIK mplayer does not use speex32.acm.
LoRd_MuldeR
11th March 2010, 15:44
That sounds more like a demuxer problem, not a problem of missing Speex decoder. MPlayer should have a Speex decoder built-in, so no need for an external DLL.
I guess that there simply is no "standard" FourCC code for signaling Speex audio in AVI and thus it isn't recognized/demuxer properly. Well, why do you have Speex in AVI at all ???
roozhou
11th March 2010, 19:01
@Midzuki
Can you upload a sample?
I guess that there simply is no "standard" FourCC code for signaling Speex audio in AVI and thus it isn't recognized/demuxer properly. Well, why do you have Speex in AVI at all ???
TwoCC 0xA109 is not found in codecs.conf. Perhaps simply adding "format 0xA109" will make mplayer work.
Technically AVI supports any audio codec with fixed sample rate and frame size, and AFAIK speex is qualified.
Reimar
11th March 2010, 19:05
Probably all that's needed is adding the format to codecs.conf, but without a sample file it's impossible to say.
I've never seen speex in AVI and there is no such file even in the huge MPlayer samples collection.
Midzuki
11th March 2010, 20:24
@ roozhou:
http://cid-5acf098e0ebae8d5.skydrive.live.com/self.aspx/.Public/tttspeex.avi
@ Reimar:
I've never seen speex in AVI and there is no such file even in the huge MPlayer samples collection.
That's really weird, considering the Speex ACM driver is several years old already...
Besides, from what I've read (and tried) thus far, Speex in Matroska is not supported by MKVtoolnix. :(
mariush
11th March 2010, 23:45
It's probably just the sample or my VLC but on my PC VLC says the samples headers are corrupted...
avi debug: stream[0] rate:30 scale:1 samplesize:0
avi debug: stream[0] video(WMV3) 576x288 24bpp 30.000000fps
main debug: selecting program id=0
avi debug: stream[1] rate:5610 scale:561 samplesize:561
avi debug: stream[1] audio(0xa109) 2 channels 32000Hz 10bits
avi debug: stream[0] created 2310 index entries
avi debug: stream[1] created 766 index entries
avi debug: stream[0] length:77 (based on index)
avi debug: stream[1] length:77 (based on index)
[...]
main debug: looking for decoder module: 35 candidates
main debug: using decoder module "speex"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: thread (decoder) created at priority 2 (../.././src/input/decoder.c:315)
main debug: thread started
speex error: header data corrupted
[...]
main debug: Buffering 33%
main debug: Buffering 41%
speex error: cannot read Speex header
speex error: initial Speex header is corrupted
main debug: Buffering 50%
[...]
main debug: Decoder buffering done in 197 ms
qt4 debug: Qt: Entering Fullscreen
speex error: cannot read Speex header
speex error: initial Speex header is corrupted
main debug: Post-processing available
main warning: late picture skipped (4334 > -757)
speex error: cannot read Speex header
speex error: initial Speex header is corrupted
speex error: cannot read Speex header
[...]
roozhou
12th March 2010, 03:23
How did you produce such files? Is "speex acm" similar to "vorbis acm" which should no longer be used? If I add twocc to mplayer's codecs.conf, mplayer will crash after complaining "notification: This doesn't look like a Speex file". I also added acm codec to condecs.conf and again mplayer crashes after loading the dll. This file can only be decoded by speex acm decoder and speex directshow decoder doesn't work.
Can anybody explain the difference between normal speex and speex acm, as well as vorbis and vorbis acm?
Midzuki
12th March 2010, 03:49
That AVI file was created in VirtualDub (WMV9 VfW + Speex ACM). No, the Speex ACM driver is quite different from the Vorbis one, because it works :) — I mean, it does not lead to sync issues, nor makes the video go jerky. SFAIK, the Speex DS decoder only connects to an Ogg splitter, so it's not suitable for AVIs. :(
In theory, Vorbis can be wrapped in the AVI container, even though it would be an ingenious hack. The only problem is, nobody has managed (or cared)
to produce a decent implementation of the ACM driver.
roozhou
12th March 2010, 04:03
That AVI file was created in VirtualDub (WMV9 VfW + Speex ACM). No, the Speex ACM driver is quite different from the Vorbis one, because it works :) — I mean, it does not lead to sync issues, nor makes the video go jerky. SFAIK, the Speex DS decoder only connects to an Ogg splitter, so it's not suitable for AVIs. :(
MP3, AC3, DTS and AAC in AVI can be decoded by both ACM decoders and dshow decoders, and other non-dshow players like mplayer and VLC. However what is wrong with speex?
In theory, Vorbis can be wrapped in the AVI container, even though it would be an ingenious hack. The only problem is, nobody has managed (or cared)
to produce a decent implementation of the ACM driver.
AFAIK Vorbis uses variable frame size (2^6 ~ 2^16 samples), so how can you wrap such vfr audio track into avi?
And we don't need acm to store audio in AVI. AVI is not VFW+ACM.
Dark Shikari
12th March 2010, 04:08
AFAIK Vorbis uses variable frame size (2^6 ~ 2^16 samples), so how can you wrap such vfr audio track into avi?By the ugliest hack in AVI history: putting it inside Ogg, and then putting Ogg inside AVI.
Basically nothing supports it.
roozhou
12th March 2010, 04:18
By the ugliest hack in AVI history: putting it inside Ogg, and then putting Ogg inside AVI.
Basically nothing supports it.
And what the heck is Vorbis ACM? There are several versions of vorbis acm w/ different twocc such as mode1, mode2 and mode3+. They are not compatible with normal vorbis. Why did xiph create such crap?
Dark Shikari
12th March 2010, 04:21
And what the heck is Vorbis ACM? There are several versions of vorbis acm w/ different twocc such as mode1, mode2 and mode3+. They are not compatible with normal vorbis. Why did xiph create such crap?That's what Vorbis ACM is; Ogg inside AVI.
As far as I know, even Xiph were not stupid enough to think such a thing was a good idea. I don't think any Xiph tools support it; it was some Japanese guys who made the ACM or something like that.
The good thing is that it didn't really catch on...
Midzuki
12th March 2010, 05:03
http://wiki.xiph.org/Oggless#Example_and_Discussion_of_the_AVI_container
says:
AVI does not have timestamps, but each chunk has a constant duration, while Vorbis packets can have one of 2 durations. If now the AVI header is set up in a way that each AVI chunk has the same duration as the smaller duration of the 2 possibilities in Vorbis, then simply inserting empty AVI chunks will allow every AVI chunk to have the correct duration. This is of course not the most beautiful solution but it is the only way to keep things exact. Additionally, note that empty chunks have been used since ages in AVI to lengthen the duration of video chunks.
N.B.: If the quotation above is "100% B.S.", blame it on Xiph.Org, not on me. :o
@ roozhou: I have no idea of what are the possible differences between Speex-in-AVI, Speex-in-Ogg, and Speex-in-MKV. :( Speex is not bad, but it's a shame that, so far at least, it can "work properly" only when inside an Ogg-wrapper. :mad:
roozhou
12th March 2010, 05:12
N.B.: If the quotation above is "100% B.S.", blame it on Xiph.Org, not on me. :o
Seems they use the same way as how vfr videos are stored in avi. But I have no idea whether it will work with audio streams.
@ roozhou: I have no idea of what are the possible differences between Speex-in-AVI, Speex-in-Ogg, and Speex-in-MKV. :( Speex is not bad, but it's a shame that, so far at least, it can "work properly" only when inside an Ogg-wrapper. :mad:
MPlayer works with speex-in-speex, speex-in-Ogg and speex-in-mkv, but not with speex-in-avi. I doubt speex vcm is just another ugly hack similar to vorbis acm.
Reimar
12th March 2010, 19:38
How did you produce such files? Is "speex acm" similar to "vorbis acm" which should no longer be used? If I add twocc to mplayer's codecs.conf, mplayer will crash after complaining "notification: This doesn't look like a Speex file". I also added acm codec to condecs.conf and again mplayer crashes after loading the dll. This file can only be decoded by speex acm decoder and speex directshow decoder doesn't work.
Can anybody explain the difference between normal speex and speex acm, as well as vorbis and vorbis acm?
First, you could have tested without modifying codecs.conf by using the option "-ac +speex".
As for speex acm, there are at least two variants: speex.acm (from the no longer existing openacm.org) and speexw.acm.
Each of them have invented their own header format which contains things like the coding mode used, and both are different from the "official" one speex in Ogg uses, while of course still both use the same format tag.
Anyway, the sample file above now works in MPlayer with SVN r30885, however given that the openacm codec is no longer downloadable, the format was never documented and it seems neither were any sources ever available I sure wouldn't recommend to use it to generate files intended for long-term storage.
Midzuki
12th March 2010, 22:31
Anyway, the sample file above now works in MPlayer with SVN r30885
:thanks: :thanks: :thanks:
Now all that I need is a Windows binary of MPlayer r30885. :D
however given that the openacm codec is no longer downloadable,
FWIW, I downloaded the openacm Speex 1.0.1.1 from free-codecs.com
(no source-code included, unfortunately).
the format was never documented and it seems neither were any sources ever available I sure wouldn't recommend to use it to generate files intended for long-term storage.
Source-code for the Speex ACM version 1.0.0.0:
http://cid-5acf098e0ebae8d5.skydrive.live.com/self.aspx/.Public/speexacm1000.cab
HTH.
Midzuki
13th March 2010, 16:04
Just confirming: now, Speex-in-AVI is supported by MPlayer r30886 :)
[E:\MPLAYER.DIR\MPlayer-p4-svn-30886]
=>mplayer tttspeex.avi
MPlayer Sherpya-SVN-r30886-4.2.5 (C) 2000-2010 MPlayer Team
Cannot load bitmap font: Arial
Playing tttspeex.avi.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO: [WMV3] 576x288 24bpp 30.000 fps 50.8 kbps ( 6.2 kbyte/s)
==========================================================================
Opening video decoder: [dmo] DMO video codecs
DMO dll supports VO Optimizations 0 1
DMO dll might use previous sample when requested
Decoder supports the following formats: YV12 YUY2 UYVY YVYU RGB8 RGB555 RGB565 R
GB24 RGB32
Decoder is capable of YUV output (flags 0x1b)
Movie-Aspect is undefined - no prescaling applied.
VO: [directx] 576x288 => 576x288 Planar YV12
Selected video codec: [wmv9dmo] vfm: dmo (Windows Media Video 9 DMO)
==========================================================================
==========================================================================
Opening audio decoder: [speex] Speex audio decoder
notification: This doesn't look like a Speex file
AUDIO: 32000 Hz, 2 ch, s16le, 44.9 kbit/4.38% (ratio: 5610->128000)
Selected audio codec: [speex] afm: speex (Speex audio)
==========================================================================
AO: [dsound] 32000Hz 2ch s16le (2 bytes per sample)
Starting playback...
notification: Packet is larger than allocated buffer
Exiting... (End of file)
[E:\MPLAYER.DIR\MPlayer-p4-svn-30886]
=>
Again, many many :thanks:
<TROLLING>
Speex @ 32kHz is better than WMA @ 48kHz :D
</TROLLING>
roozhou
13th March 2010, 16:54
<TROLLING>
Speex @ 32kHz is better than WMA @ 48kHz :D
</TROLLING>
At what bitrate?
Midzuki
13th March 2010, 18:28
At what bitrate?
44.8 kbps
roozhou
14th March 2010, 04:29
44.8 kbps
I don't think any audio codec without SBR at such bitrate gives good result at 48Khz. You should try HE-aac or WMA pro.
Midzuki
14th March 2010, 05:07
@ roozhou:
anything that is placed between <TROLLING> tags
must not be taken seriously. ;)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.