[FFmpeg-user] controlling bitrate for MJPEG

Neal Crook foofoobedoo at yahoo.co.uk
Tue Nov 29 18:26:21 CET 2011


Hello kind ffmpeg experts,

Starting with an uncompressed video clip in an .avi container, I wish to generate videos at various different bit-rates. The video formats I am interested in are MJPEG and H.264 I-frame only (ie H.264 with GOP=1). [The formats are chosen because they both map to relatively low cost/complexity hardware implementations].

My MJPEG incantations looks like this:

$ ffmpeg -i foo.avi -b:v 1M -codec mjpeg out_1M.avi
$ ffmpeg -i foo.avi -b:v 2M -codec mjpeg out_2M.avi

$ ffmpeg -i foo.avi -b:v 4M -codec mjpeg out_4M.avi

$ ffmpeg -i foo.avi -b:v 8M -codec mjpeg out_8M.avi
$ ffmpeg -i foo.avi -b:v 16M -codec mjpeg out_16M.avi


When I examine/analyse the out_* files I observe that the file size/bit rate does not drop below ~8Mbit/sec --  the 1M, 2M, 4M files are all comparable sizes.

I realise that the .avi container has some small overhead, and I suppose there is some lower quality limit (and associated minimum file size) for the JPEG encoding, but I was surprised to hit it so soon. Can anyone identify an error I have made or explain why I cannot reduce the file size further?

thanks,

Neal.

-----------------------
ffmpeg version 0.8.6.git, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov 25 2011 16:33:47 with gcc 4.5.1
  configuration: --prefix=/home/foo/local --enable-libx264 --enable-gpl --extra-cflags=-I/home/foo/local/include --extra-ldflags=-L/home/foo/local/lib
  libavutil    51. 28. 0 / 51. 28. 0
  libavcodec   53. 37. 0 / 53. 37. 0
  libavformat  53. 21. 0 / 53. 21. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 49. 0 /  2. 49. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0



More information about the ffmpeg-user mailing list