Tomas, Thanks for response. I already went through http protocol and found that it uses chunked encoding I want to stream it to mobile device and the unfortunately device doesn't support chunked encoding. So I am stuck and need to know the content length before hand.
Is there anyway to accurately guess the size? Sandeep. On Fri, Jul 30, 2010 at 4:55 AM, Tomas Härdin <[email protected]>wrote: > On Thu, 2010-07-29 at 17:04 -0700, Sandeep Davu wrote: > > Hi, > > > > I am downgrading the bitrate of mp3 files. Is there a way to find out the > > file size of the converted file before actually converting the audio > file. > > > > I wanted to convert a 320 kbps mp3 file to a 64 kbps mp3 file and send it > > over the wire using http. > > For this I need the content-length filed which is the size of the > converted > > file. > > I preserved the sampling rate and number of channels of the original > file. > > > > Is this formula corrext > > inputFormatContext->duration * outputCodecCtx->birate (given that the > number > > of channels are same) > > > > for some files this formula works, but not for all the files. > > Is there a more accurate way to calculate the file size beforehand. > > > > Sandeep. > > Why not send the file using chunked encoding like libavformat's http > protocol does? That way you don't need to know the size of the file. > > If you're serving the file instead, then you could simply choose not to > specify the content-length - just stream it out. The user can't seek > anyway. > > /Tomas > > _______________________________________________ > libav-user mailing list > [email protected] > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
