1
I want to use lame to encode mp3 files, but instead of writing it directly to a file I want to pipe it into another program that will eventually write it out somewhere. The problem is that if lame detects that its output is a stream then it doesn't write the VBR header and players figure out the length of the file wrong. For example, if I do this, then the resulting file will be wrong:
lame infile.wav - >outfile.mp3
I tried the following trick:
lame infile.wav /dev/stdout >outfile.mp3
It seems to work at first, but only if the stdout is directly redirected to a file. The following case doesn't work:
lame infile.wav /dev/stdout | cat >outfile.mp3
If I use ffmpeg (or avconv) as a front end to lame, I got exactly the same problem.
Is there any way to tell lame that I want it to write the VBR header even if it thinks it is writing to a stream?
Thanks for this information, after all these years =) – Niloct – 2018-10-27T06:18:32.657