bmp - How to specify size of output image in ffmpeg command? -


i'm extracting frame images mp4 video using ffmpeg in terminal.

i used command:

ffmpeg -i video.mp4 pictures%d.bmp 

problem extracted images have size of 4.5-5mb! want smaller images, around 1-2 mb. how limit size of output images?

the file size function of video resolution , of output format choose. example:

width x height x 3 bytes ( rgb24) 

you have different ways reduce output file size.

  1. change format example yuv 4:2:0 -pix_fmt yuv420 , think smaller format can choose gray or yuv400 check following command showing ffmpeg supported pixel format

    ‘ffmpeg -pix_fmts

the bmp format should handle (generate 8bpp image) confirm file size factor 3!

  1. change output resolution (hd sd or cif) -s <width>x<height>, e.g.:

    ffmpeg -i video.mp4 -s 192x168 pictures%d.bmp 

    or -vf option:

    ffmpeg -i video.mp4 -vf scale=192:168 pictures%d.bmp 

Comments