Problems playing AVIs with AAC Audio encoded by mencoder

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
joernu
New Cone
New Cone
Posts: 4
Joined: 04 Feb 2007 14:52

Problems playing AVIs with AAC Audio encoded by mencoder

Postby joernu » 04 Feb 2007 15:34

Hi guys,

I am transcoding my TV recordings to AVIs with mencoder using x264 and FAAC library.
Supposedly those should be playable by VLC according to the supported codecs.
They play (naturally) with MPlayer and e.g. gspot also identifies the audio track as being of aac type.

However, the audio is not played by VLC 0.8.6a (only windows version tested, since I couldnt get the linux one to compile and playback anything so far).
Instead the audiostream is identified as being of 'undf' type and not played, since it seems to be an unsupported codec.

The blame seems to be at VLC, since gspot correctly identifies the used audio codec.

However, I cannot be sure about this. I put a 1.3 MB test file to http://www.joern-ungermann.de/files/test.avi

I've looked all over the web and did not find this problem so far. Most people using mencoder use probably als mplayer to play it back...

Thanks for your help,

joernu

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Postby Jean-Baptiste Kempf » 04 Feb 2007 19:35

[00000556] avi demuxer debug: stream[1] rate:48000 scale:1024 samplesize:0
[00000556] avi demuxer debug: stream[1] audio(0x706d) 2 channels 48000Hz 0bits
[00000556] avi demuxer warning: cannot find idx1 chunk, no index defined
[00000556] avi demuxer warning: cannot find indx (misdetect/broken OpenDML file?)
[00000556] avi demuxer warning: cannot find indx (misdetect/broken OpenDML file?)


I don't have a clue...

48000Hz, 0bits ???? wtf ? No idea.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

joernu
New Cone
New Cone
Posts: 4
Joined: 04 Feb 2007 14:52

Postby joernu » 04 Feb 2007 20:40

Mmmh...
playing the file with MPlayer gives

Code: Select all

========================================================================== Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding) AUDIO: 48000 Hz, 2 ch, s16le, 151.8 kbit/9.88% (ratio: 18970->192000) Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder) ========================================================================== AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
which hints at 16bits per sample, however, the encoding shows:

Code: Select all

========================================================================== Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??... [libaf] Adding filter dummy [dummy] Was reinitialized: 48000Hz/2ch/s16le [dummy] Was reinitialized: 48000Hz/2ch/s16le AE_FAAC, sample_input: 2048, max_bytes_output: 1536 Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le... [dummy] Was reinitialized: 48000Hz/2ch/s16le [dummy] Was reinitialized: 48000Hz/2ch/s16le ======= WAVE Format ======= Format Tag: 28781 (0x706D) Channels: 2 Samplerate: 48000 avg byte/sec: 16000 Block align: 1024 bits/sample: 0 cbSize: 0 ==========================================================================
which seems at least fishy.

However, I am not knowledgable enough about AAC to know if this is normal or shows a bug in libaac/mencoder.

On the other hand "audio(0x706d)" is definetly the tag of aac/faad and *not* undf.

BTW, playing around with encoding options didn't change anything (e.g. switching between mpeg level 2 or 4).

DJ
Cone Master
Cone Master
Posts: 8206
Joined: 01 Jan 2006 04:30
Location: Koloa, Hawaii USA

Postby DJ » 04 Feb 2007 23:01

While this file does play in MPlayer I can't find anything else that plays it and I have two standard AAC codecs for Direct Show. Both show errors. H.264 and AAC in an AVI container is not the usual or suggested container and this may be part of the problem.

If I pull the file apart and try to play the resulting .raw audio file (wasn't recognized by the program used to extract the files) in MPlayer this is the reporting:

Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2

Conclusion: The file was made improperly with no bit rate specified so no other player will play this file.

If I give the audio file a .aac extension and then re-muxed the file as .mp4 the file plays correctly. This indicates a problem in memcoder when the file was made or perhaps an issue in the AVI muxer as this combination you used is considered non-standard.

At any rate this is NOT a VLC issue.

joernu
New Cone
New Cone
Posts: 4
Joined: 04 Feb 2007 14:52

Postby joernu » 05 Feb 2007 17:56

Thanks for the effort.

The wrongly indicated audiostream *type* seemed to point in VLC's direction, however, the encoding might very well be broken.

I'll go experiment a bit more to see what goes wrong on the encoding side.

joernu
New Cone
New Cone
Posts: 4
Joined: 04 Feb 2007 14:52

Postby joernu » 07 Feb 2007 18:48

OK, further testing have not gotten the file to be playable with VLC (mencoder offers different (experimental) muxers of which mp4 works, but avi/asf still dont. However, the bits per sample is correctly recognized).

All files play flawlessly with 'ffplay' on my linux machine, btw.

However, further digging showed that avi, is not the best format for vbr audio and faac is not the best audio encoder anyway. I think, that aac may not actually be supported by avi.
So I'll switch to vorbis and mkv, circumventing the problem altogether :-)

DJ
Cone Master
Cone Master
Posts: 8206
Joined: 01 Jan 2006 04:30
Location: Koloa, Hawaii USA

Postby DJ » 07 Feb 2007 19:25

Vorbis can only be VBR, not recommended for audio for video even though lots of people do it. This leaves the video less stable than it should be. Yet the picky anime people that frequent this forum don't seem to mind this flaw.

joseph
New Cone
New Cone
Posts: 9
Joined: 02 May 2007 21:28

same issue here

Postby joseph » 02 May 2007 23:01

i've got the same issue on gentoo... x264/faac inside an avi created with mencoder. plays fine with mplayer and ffmpeg, no audio with vlc, xine, and wmp9.

encoded with

Code: Select all

mencoder -oac faac -faacopts object=1:tns:quality=100
plays in mplayer with

Code: Select all

==> Found audio stream: 1 ====== STREAM Header ===== Type: auds FCC: mp (706D) Flags: 0 Priority: 0 Language: 0 InitialFrames: 24 Rate: 48000/1024 = 46.875 Start: 4 Len: 63027 Suggested BufferSize: 7168 Quality 0 Sample size: 0 ========================== Found 'wf', 18 bytes of 18 ======= WAVE Format ======= Format Tag: 28781 (0x706D) Channels: 2 Samplerate: 48000 avg byte/sec: 17386 Block align: 1024 bits/sample: 0 cbSize: 0
and

Code: Select all

Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding) dec_audio: Allocating 4608 bytes for input buffer. dec_audio: Allocating 49152 + 65536 = 114688 bytes for output buffer. AAC_PROBE: 4608 bytes AAC_PROBE: ret 0 FAAD: Decoder init done (4608Bytes)! FAAD: Negotiated samplerate: 48000Hz channels: 2 FAAD: got 139kbit/s bitrate from MP4 header! AUDIO: 48000 Hz, 2 ch, s16le, 139.1 kbit/9.06% (ratio: 17386->192000) Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder) ========================================================================== Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??... [libaf] Adding filter dummy [dummy] Was reinitialized: 48000Hz/2ch/s16le [dummy] Was reinitialized: 48000Hz/2ch/s16le ao2: 48000 Hz 2 chans s16le audio_setup: using '/dev/dsp' dsp device audio_setup: using '/dev/mixer' mixer device audio_setup: using 'pcm' mixer device audio_setup: sample format: s16le (requested: s16le) audio_setup: using 2 channels (requested: 2) audio_setup: using 48000 Hz samplerate (requested: 48000) audio_setup: frags: 16/16 (4096 bytes/frag) free: 65536 AO: [oss] 48000Hz 2ch s16le (2 bytes per sample) AO: Description: OSS/ioctl audio output AO: Author: A'rpi Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le... [dummy] Was reinitialized: 48000Hz/2ch/s16le [dummy] Was reinitialized: 48000Hz/2ch/s16le
but vlc gives me

Code: Select all

[00000309] avi demuxer debug: stream[0] rate:24000 scale:1001 samplesize:0 [00000309] avi demuxer debug: stream[0] video(h264) 576x432 24bpp 23.976024fps [00000297] main input debug: selecting program id=0 [00000309] avi demuxer debug: stream[1] rate:48000 scale:1024 samplesize:0 [00000309] avi demuxer debug: stream[1] audio(0x706d) 2 channels 48000Hz 0bits [00000309] avi demuxer debug: stream[0] created 32241 index entries [00000309] avi demuxer debug: stream[1] created 63027 index entries [00000309] avi demuxer debug: stream[0] length:1344 (based on index) [00000309] avi demuxer debug: stream[1] length:1344 (based on index) [00000309] main demuxer debug: using demux2 module "avi" [00000297] main input debug: looking for a subtitle file in /home/joseph/ [00000311] main decoder debug: looking for decoder module: 23 candidates [00000311] ffmpeg decoder debug: libavcodec initialized (interface 3352578 ) [00000311] ffmpeg decoder debug: postprocessing disabled [00000311] ffmpeg decoder debug: ffmpeg codec (h264) started [00000311] main decoder debug: using decoder module "ffmpeg" [00000311] main decoder debug: thread 2977434512 (decoder) created at priority 0 (input/decoder.c:159) [00000340] main decoder debug: looking for decoder module: 23 candidates [00000340] main decoder error: no suitable decoder module for fourcc `undf'. VLC probably does not support this sound or video format. [00000340] main decoder debug: killing decoder fourcc `undf', 0 PES in FIFO
i know enough to be dangerous but not entirely sure what's the best approach. does "0 bits" in mplayer and vlc mean that it's a VBR audio, and mplayer can handle it but vlc can't? does anyone know how to work around this [even in mencoder]?

Thanks!

Joseph Cheek

joseph
New Cone
New Cone
Posts: 9
Joined: 02 May 2007 21:28

fixed bitrate no good

Postby joseph » 02 May 2007 23:19

i re-encoded with mencoder using a fixed bit rate this time. no change, still doesn't play in vlc. i would like to use AAC for this, i really like the quality for the size it has.

any1 have ideas? i notice that gentoo's ebuild doesn't compile with faad2, it used ffmpeg for aac instead...

Lotesdelere
Cone Master
Cone Master
Posts: 10171
Joined: 08 Sep 2006 04:39
Location: Europe

Re: Problems playing AVIs with AAC Audio encoded by mencoder

Postby Lotesdelere » 03 May 2007 02:46

However, the audio is not played by VLC 0.8.6a (only windows version tested)
The file is playing fine in recent VLC 0.9.0 nightly builds for Windows though :)

MP4A
Audio
Channels: 2
48000 Hz
151 kb/s

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Problems playing AVIs with AAC Audio encoded by mencoder

Postby Jean-Baptiste Kempf » 03 May 2007 10:26

However, the audio is not played by VLC 0.8.6a (only windows version tested)
The file is playing fine in recent VLC 0.9.0 nightly builds for Windows though :)

MP4A
Audio
Channels: 2
48000 Hz
151 kb/s
Happy to know it!
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

joseph
New Cone
New Cone
Posts: 9
Joined: 02 May 2007 21:28

hmmm

Postby joseph » 04 May 2007 00:53

loading from today's svn i get the fourcc recognized, but neither video nor audio play:

Code: Select all

joseph-dt:~$ vlc get_smart_3_1_2.avi VLC media player 0.9.0-svn Grishenko [00000325] main playlist error: Reloading playlist not implemented. [00000348] main decoder error: no suitable decoder module for fourcc `h264'. VLC probably does not support this sound or video format. [00000390] main decoder error: no suitable decoder module for fourcc `mp4a'. VLC probably does not support this sound or video format. joseph-dt:~$ vlc -l | grep aac VLC media player 0.9.0-svn Grishenko joseph-dt:~$ vlc -l | grep 264 VLC media player 0.9.0-svn Grishenko x264 H.264/MPEG4 AVC encoder (using x264 library) h264 H264 video demuxer packetizer_h264 H.264 video packetizer
i configured with --enable-aac and --enable-ffmpeg and --disable-faad (it would be great if faad compiled when it was enabled).

any more ideas?

thanks so much for your help, i hope i am close!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: hmmm

Postby Jean-Baptiste Kempf » 04 May 2007 01:28

loading from today's svn i get the fourcc recognized, but neither video nor audio play:

Code: Select all

joseph-dt:~$ vlc get_smart_3_1_2.avi VLC media player 0.9.0-svn Grishenko [00000325] main playlist error: Reloading playlist not implemented. [00000348] main decoder error: no suitable decoder module for fourcc `h264'. VLC probably does not support this sound or video format. [00000390] main decoder error: no suitable decoder module for fourcc `mp4a'. VLC probably does not support this sound or video format. joseph-dt:~$ vlc -l | grep aac VLC media player 0.9.0-svn Grishenko joseph-dt:~$ vlc -l | grep 264 VLC media player 0.9.0-svn Grishenko x264 H.264/MPEG4 AVC encoder (using x264 library) h264 H264 video demuxer packetizer_h264 H.264 video packetizer
i configured with --enable-aac and --enable-ffmpeg and --disable-faad (it would be great if faad compiled when it was enabled).

any more ideas?

thanks so much for your help, i hope i am close!
disable-faad means disable aac decoder !
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

joseph
New Cone
New Cone
Posts: 9
Joined: 02 May 2007 21:28

Re: hmmm

Postby joseph » 04 May 2007 17:59

disable-faad means disable aac decoder !
yes but ffmpeg supports aac, and you saw that ffmpeg was enabled. --enable-faad doesn't compile, either on 0.8.6b or svn trunk:

Code: Select all

/bin/sh ../../libtool --tag=CC --mode=compile i686-pc-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -DSYS_LINUX -I../../include `top_builddir="../.." ../../vlc-config --cflags plugin faad` -Wall -Wextra -Wno-unused-parameter -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wold-style-definition -Wmissing-prototypes -MT libfaad_plugin_la-faad.lo -MD -MP -MF .deps/libfaad_plugin_la-faad.Tpo -c -o libfaad_plugin_la-faad.lo `test -f 'faad.c' || echo './'`faad.c i686-pc-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -DSYS_LINUX -I../../include -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -DLOCALEDIR=\"/usr/share/locale\" -DDATA_PATH=\"/usr/share/vlc\" -DPLUGIN_PATH=\"/usr/lib/vlc\" -O2 -D__LIBVLC__ -D__PLUGIN__ -DMODULE_NAME=faad -DMODULE_NAME_IS_faad -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wold-style-definition -Wmissing-prototypes -MT libfaad_plugin_la-faad.lo -MD -MP -MF .deps/libfaad_plugin_la-faad.Tpo -c faad.c -fPIC -DPIC -o .libs/libfaad_plugin_la-faad.o faad.c: In function `Open': faad.c:141: warning: passing arg 4 of `faacDecInit2' from incompatible pointer type faad.c: In function `DecodeBlock': faad.c:217: warning: passing arg 4 of `faacDecInit2' from incompatible pointer type faad.c:233: warning: passing arg 4 of `faacDecInit' from incompatible pointer type faad.c:319: error: structure has no member named `ps' faad.c:324: error: structure has no member named `ps' faad.c:338: error: structure has no member named `ps' make[4]: *** [libfaad_plugin_la-faad.lo] Error 1 make[4]: Leaving directory `/home/joseph/vlc/modules/codec' make[3]: *** [all-modules] Error 1 make[3]: Leaving directory `/home/joseph/vlc/modules/codec' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/joseph/vlc/modules' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/joseph/vlc' make: *** [all] Error 2
I assume that this is a known issue and has been ignored because ffmpeg supports aac. Is that correct?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: hmmm

Postby Jean-Baptiste Kempf » 05 May 2007 00:47

[quote="joseph"]
yes but ffmpeg supports aac, and you saw that ffmpeg was enabled. --enable-faad doesn't compile, either on 0.8.6b or svn trunk:

[/code]

No you are wrong. We build windows, mac and Linux versions WITH libfaad. and it does compile. Both 0.8.6b and trunk. look at our buildbot or in the contribs.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

joseph
New Cone
New Cone
Posts: 9
Joined: 02 May 2007 21:28

Re: hmmm

Postby joseph » 07 May 2007 20:01

No you are wrong. We build windows, mac and Linux versions WITH libfaad. and it does compile. Both 0.8.6b and trunk. look at our buildbot or in the contribs.
which version of libfaad, from where?

joseph
New Cone
New Cone
Posts: 9
Joined: 02 May 2007 21:28

Re: hmmm

Postby joseph » 07 May 2007 22:51

ok, i found faad2-20040923.tar.bz2 in the 0.8.5 extras/contrib dir, and vlc trunk compiles against it! but now the ffmpeg module doesn't load...

Code: Select all

[00000001] main libvlc warning: cannot load module `/usr/local/lib/vlc/codec/libffmpeg_plugin.so' (/usr/local/lib/vlc/codec/libffmpeg_plugin.so: undefined symbol: sws_scale_ordered)
any idea how to get around this? i have recompiled vlc trunk and ffmpeg-0.4.9_p20070330. now i have sound but no video 8-(.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: hmmm

Postby Jean-Baptiste Kempf » 08 May 2007 18:43

ok, i found faad2-20040923.tar.bz2 in the 0.8.5 extras/contrib dir, and vlc trunk compiles against it! but now the ffmpeg module doesn't load...

Code: Select all

[00000001] main libvlc warning: cannot load module `/usr/local/lib/vlc/codec/libffmpeg_plugin.so' (/usr/local/lib/vlc/codec/libffmpeg_plugin.so: undefined symbol: sws_scale_ordered)
any idea how to get around this? i have recompiled vlc trunk and ffmpeg-0.4.9_p20070330. now i have sound but no video 8-(.
Don't compile ffmpeg with faad2, but compile VLC with faad.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

joseph
New Cone
New Cone
Posts: 9
Joined: 02 May 2007 21:28

Re: hmmm

Postby joseph » 09 May 2007 16:49

Don't compile ffmpeg with faad2, but compile VLC with faad.
this, unfortunately, gives the same result:

Code: Select all

# USE=-aac emerge -v ffmpeg (blah, ^D...) $ cd vlc-trunk $ ./configure --enable-x264 --enable-ffmpeg --enable-faad $ make -j3 $ sudo make install $ /usr/local/bin/vlc -v get_smart_3_1_2.avi VLC media player 0.9.0-svn Grishenko [00000001] main libvlc warning: This doesn't look like a valid plugins cache [00000001] main libvlc warning: cannot load module `/usr/local/lib/vlc/codec/libffmpeg_plugin.so' (/usr/local/lib/vlc/codec/libffmpeg_plugin.so: undefined symbol: sws_scale_ordered) [00000223] main playlist error: Reloading playlist not implemented. Remote control interface initialized. Type `help' for help. [00000230] main demuxer warning: no access_demux module matched "any" [00000232] avi private warning: unknown chunk (not loaded) [00000234] main decoder error: no suitable decoder module for fourcc `h264'. VLC probably does not support this sound or video format.
the only difference is that now, with ffmpeg not doing faad2, i can't use ffplay to view the videos either 8-(. i'm sure there's something simple that i'm doing wrong, unless it is really this hard to get going?

joseph
New Cone
New Cone
Posts: 9
Joined: 02 May 2007 21:28

just to make sure i'm not crazy...

Postby joseph » 09 May 2007 16:58

... i compiled vlc trunk w/o any ffmpeg, just x264 and faad.

Code: Select all

$ ./configure --enable-x264 --disable-ffmpeg --enable-faad $ make -j3 $ sudo make install $ sudo rm /usr/local/lib/vlc/codec/libffmpeg_plugin.so $ rm -rf ~/.vlc $ /usr/local/bin/vlc -v get_smart_3_1_2.avi VLC media player 0.9.0-svn Grishenko [00000001] main libvlc warning: could not open plugins cache file /home/joseph/.vlc/cache/plugins-04041e.dat for reading [00000223] main playlist error: Reloading playlist not implemented. Remote control interface initialized. Type `help' for help. [00000230] main demuxer warning: no access_demux module matched "any" [00000232] avi private warning: unknown chunk (not loaded) [00000234] main decoder error: no suitable decoder module for fourcc `h264'. VLC probably does not support this sound or video format.
still no dice, even with ffmpeg out of the picture. 8-(


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 27 guests