[MPlayer-users] muxing vorbis audio with mencoder?

D Richard Felker III dalias at aerifal.cx
Sat Jul 20 22:00:02 CEST 2002


On Sat, Jul 20, 2002 at 03:38:11PM -0400, D Richard Felker III wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> On Sat, Jul 20, 2002 at 02:37:28AM -0400, D Richard Felker III wrote:
> > Anyone had success muxing vorbis audio into an avi file with mencoder?
> > I'm using the following command line:
> > 
> > mencoder foo.avi -audiofile bar.ogg -ovc copy -oac copy -noskip -mc 0
> > 
> > Without -noskip, I get lots of (bogus) skipped frames, which corrupts
> > the video since many I/P frames get lost. With or without that option,
> > the audio doesn't work in the output file. Mplayer gives the following
> > output:
> > 
> > AVI OGG : Initial audio header is too small !!!!!
> > [V] filefmt:3  fourcc:0x33564944  size:352x240  fps:23.98  ftime:=0.0417
> > get_path('sub/') -> '/home/dalias/.mplayer/sub/'
> > Detected audio codec: [vorbis] afm:10 (OggVorbis Audio Decoder)
> > Initializing audio codec...
> > Opening audio decoder: [libvorbis] Ogg/Vorbis audio decoder
> > dec_audio: Allocating 4096 + 65536 = 69632 bytes for output buffer
> > OggVorbis: initial (identification) header broken!
> > ADecoder init failed :(
> > Couldn't initialize audio codec! -> nosound
> 
> I think I found the problem. It appears that the ogg demuxer munches
> the first packet (with all the header info) when it opens the stream.
> Thus, -oac copy starts copying with the second packet, which is bogus.
> Any suggestions on how to fix this?

Actually, now that I think about it, it seems like removing this
header is probably the appropriate behavior for the demuxer. It makes
sense for such a header to be contained in the ogg file to identify
the stream, but in an avi file or other container format, there are
already other headers for this purpose, and the audio stream in the
avi file should just be the raw audio packets, not any special header
info.

So, it seems to me that ad_vorbis.c should be modified to construct a
valid vorbis audio header from the waveformat header in the avi, and
pass that along to libvorbis instead. Comments, anyone? Should I move
this thread to the dev list?

Rich




More information about the MPlayer-users mailing list