[MPlayer-users] Possibly incorrect waveheader in -ao pcm

Igor Katson descentspb at gmail.com
Tue Mar 10 16:26:48 CET 2009


Reimar Döffinger wrote:
> On Tue, Mar 10, 2009 at 02:29:46PM +0300, Igor Katson wrote:
>   
>> The problem is, that when I make a fifo, and send mplayer output to
>> -ao pcm:file=fifo,
>> and start encoding with oggenc, oggenc looks at the header
>> and thinks that the file is only 1 hour length, though it is much more,
>> and when an hour is encoded, oggenc just stops the process.
>>     
>
> Well, the problem is that it is not possible to put more than one hour
> of uncompressed data into wav, since wav specifies the size of the
> data as 32 bit values (due to broken sign handling actually 31 bit).
> One hour of data is already ca. 2 GB, and thus the limit for wav is
> reached (not sure if there are ODML extensions for wav, but even then I
> doubt oggenc would support them).
> Now as to why FFmpeg works: It just sets all those size values to 0 at
> the start, and oggenc obviously has special hacks to ignore that (if it
> behaved "correctly" oggenc would not encode a single byte with FFmpeg).
>   
Thanks for a great explanation, Reimar.
> Your options:
> 1) hack MPlayer, change libao2/ao_pcm.c the lines
>   
>>  wavhdr.data_length=le2me_32(0x7ffff000);
>>  wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
>>     
> to
>   
>>  wavhdr.data_length=0;
>>  wavhdr.file_length = 0;
>>     
> this will most likely break other applications. You could also make a
> patch so you can select which method ao_pcm uses.
>   
I don't know C to write acceptable patches, and don't want to use these 
kind of workarounds,
especially regarding that it's not an MPlayer bug.
> 2) use FFmpeg's wav writing method via mencoder, something like:
> mencoder -oac pcm -novideo -of lavf -lavfopts format=wav -o -
>
> 3) use AIFF format, though you have to use mencoder for that, too:
> mencoder -oac pcm -novideo -of lavf -lavfopts format=aiff -o -
>   
1. Never knew that mencoder could output to STDOUT and there is nothing 
about that
in the manpage (that's why i was using fifos). Also some of the 
mplayer/mencoder textual output goes to stdout.
2. In both cases mencoder says that the video stream is mandatory. 
(offtop: so is it possible to encode
audio files with mencoder? Couldn't find it in google.)
3. Due to both previous problems, oggenc says that the format is not 
supported.

P.S. It's a pitty, that mencoder does not support -oac libvorbis or smth.

Thanks in advance.



More information about the MPlayer-users mailing list