Length field for encoded mp3s

Noufal Ibrahim <[email protected]>
Newsgroups gmane.comp.audio.mp3.lame
Message-ID <[email protected]>
Hello everyone,
        I'm processing some .flac files and converting them into mp3s. I
have a pipeline that uses ffmpeg to convert the flac files to wav files
and then pipe that through the lame[1] executable to create mp3s

        The entire pipeline looks something like this

ffmpeg -v 0 -y -vn -i sample.flac  -ac 2 -ar 44100 -f wav - | /usr/bin/lame --disptime 10 --preset standard --ta 'Artist name' --tt 'Song title' --tn '01' --tl 'Album name' --tg 'Rock' --add-id3v2  --tc 'Comment' - sample.mp3

        The quality of the produced mp3 is good but when I open it in audacity and open the metadata editor, it reports the length as '0'. Trying to extract the metadata reports something similar. It says that the 'TLEN' field is 0. 

        I tried to forcibly set it by passing 

        --tv 'TLEN=25' 

        to lame but it didn't work. One way that I've verified is to have ffmpeg output the wav onto disk and then give that to lame as input but this creates a temporary file and it is something which I can't do right now in my setup. I do know the length of track in seconds so if there's some reliable way I can give this to the encoder, it would be sufficient. 

        How do I do this? 

Thanks

Footnotes: 
[1]  LAME 64bits version 3.99.5 (http://lame.sf.net)

-- 
Cordially,
Noufal
http://nibrahim.net.in

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.