[FFmpeg-user] Set target file size

James Darnley james.darnley at gmail.com
Tue May 27 13:04:11 CEST 2014


On 2014-05-27 12:49, Takashi wrote:
> I would like to convert a file to a given target file size (quality is
> less important than file size in this case).
> 
> As far as I understand, the best approach for this is to use two pass
> encoding. I followed the instructions here:
> http://trac.ffmpeg.org/wiki/x264EncodingGuide (Two-pass Example)
> 
> The problem is that my converted file is always smaller than intended.
> 
> How can I fix that?
> 
> Example calculation (target file size = 8MB):
> (8 MB * 8192 [converts MB to kilobits]) / 55 seconds = ~1192 kilobits/s
> total bitrate
> 1192k - 128k (desired audio bitrate) = 1064k video bitrate

Wrong.  8MiB = 67108864 bits -> 1220 kb/s

Anyway, why are you trying to make the file bigger than the input?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 683 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140527/56b2f18d/attachment.asc>


More information about the ffmpeg-user mailing list