I'm using mencoder to encode a video with lavc codecs:
Code:
mencoder test.mp4 -ovc copy -oac lavc -lavcopts acodec=ac3:abitrate=64 -o test.avi -audio-preload 0.174
The test.avi file plays in vlc with no sound.

The same video encoded with avconv:
Code:
avconv -i test.mp4 -c:v copy -c:a ac3 -b:a 64k test-ac3.avi
plays ok in vlc (with sound)

I've been trying to change the codec in mencoder:
Code:
acodec=libmp3lame, acodec=vorbis, ...
And all of them plays in vlc with no sound.

All the above video files plays ok (with sound) in mplayer, totem or smplayer.

I can't guess if it's a mencoder problem, a vlc problem or the combination of this two programs.

Here's the output from Mediainfo for the test.avi file (encoded with mencoder) and test-ac3.avi (encoded with avconv).
The audio stream values are the same!

General
Complete name : test-ac3.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 1.57 MiB
Duration : 19s 992ms
Overall bit rate : 657 Kbps
Writing application : Lavf53.21.0

Video
ID : 0
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Duration : 19s 981ms
Bit rate : 392 Kbps
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 1 000.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.002
Stream size : 956 KiB (60%)

Audio
ID : 1
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Codec ID : 2000
Duration : 19s 992ms
Bit rate mode : Constant
Bit rate : 64.0 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 156 KiB (10%)
Alignment : Aligned on interleaves
Interleave, duration : 35 ms (34.81 video frames)
Interleave, preload duration : 174 ms

General
Complete name : test.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 1.11 MiB
Duration : 20s 0ms
Overall bit rate : 468 Kbps
Writing application : MEncoder svn r34540 (Ubuntu), built with gcc-4.6
Writing library : MPlayer

Video
ID : 0
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : H264
Duration : 20s 0ms
Bit rate : 391 Kbps
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.068
Stream size : 956 KiB (84%)

Audio
ID : 1
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Codec ID : 2000
Duration : 19s 992ms
Bit rate mode : Constant
Bit rate : 64.0 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 156 KiB (14%)
Alignment : Aligned on interleaves
Interleave, duration : 35 ms (0.87 video frame)
Interleave, preload duration : 174 ms

Any idea?