Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 137852

Summary: "mplayer -ao pcm" outputs corrupt sample rate in waveheader
Product: Gentoo Linux Reporter: Russell Mora <rd.mora>
Component: New packagesAssignee: Gentoo Media-video project <media-video>
Status: VERIFIED NEEDINFO    
Severity: normal    
Priority: Normal    
Version: 2006.0   
Hardware: AMD64   
OS: Other   
Whiteboard:
Package list:
Runtime testing required: ---

Description Russell Mora 2006-06-24 08:45:00 UTC
When using mplayer to generate a wave file, i.e.

#> mplayer -ao pcm -vo null -vc dummy output.avi
MPlayer dev-CVS-060414-18:32-3.4.5 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices  (Family: 15, Stepping: 2)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2



91 audio & 208 video codecs
Setting up LIRC support...
mplayer: could not open config files /root/.lircrc and /etc/lircrc
mplayer: No such file or directory
Failed to read LIRC config file ~/.lircrc.
You will not be able to use your remote control.
Playing output.avi.
AVI file format detected.
VIDEO:  [XVID]  640x368  24bpp  29.970 fps  1003.9 kbps (122.6 kbyte/s)
Clip info:
 Software: MEncoder dev-CVS-060414-18:32-3.4.5
File not found: '/root/.mplayer/default.sub'
Failed to open /root/.mplayer/default.sub
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
==========================================================================
Forced video codec: dummy
Cannot find codec matching selected -vo and video format 0x44495658.
Read DOCS/HTML/en/codecs.html!
==========================================================================
[AO PCM] File: audiodump.wav (WAVE)
PCM: Samplerate: 48000Hz Channels: Stereo Format s16le
[AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast
[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).
AO: [pcm] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
<...>

The waveheader of the resulting wave file is corrupt, e.g.:

#> toolame -p 2 -b 384 audiodump.wav output.mp2
Parsing Wave File Header
>>> Unknown samp freq 824633720880000 Hz in Wave Header
>>> Default 44.1 kHz samp freq selected
>>> Input Wave File is Stereo
--------------------------------------------
Input File : 'audiodump.wav'   44.1 kHz
<...>
See "Unknown samp freq 824633720880000 Hz in Wave Header" msg.
(NOTE: I don't think the problem is with toolame - what I'm trying to do use to work and toolame has not changed for a couple of years now)

Simple work around is to use the "nowaveheader" option and then tell toolame what the sample frequency is, i.e.

#> mplayer -ao pcm:nowaveheader -vo null -vc dummy output.avi
<...>
#> toolame -s 48  -p 2 -b 384 audiodump.wav output.mp2
No header found. Assuming Raw PCM sound file
--------------------------------------------
Input File : 'audiodump.wav'   48.0 kHz
Output File: 'output.mp2'
384 kbps MPEG-1 Layer II j-stereo Psy model 2
<...>

HTH
Comment 1 Luca Barbato gentoo-dev 2006-06-24 09:33:48 UTC
Try pre8 please
Comment 2 Russell Mora 2006-06-25 19:54:43 UTC
My bad - this has nothing to do with mplayer.  It was actually toolame, enough though it has not changed in three years (last release 2003-03-01).  Of course my old system that it use to run fine on was 32-bit whilst my new system is 64-bit - oh dear, how embarrasing....
Sorry for the noise.