[FFmpeg-trac] #10279(undetermined:closed): "width not divisible by 2" error with force_original_aspect_ratio=reduce

FFmpeg trac at avcodec.org
Sun Mar 26 15:26:26 EEST 2023

#10279: "width not divisible by 2" error with force_original_aspect_ratio=reduce
             Reporter:  php4fan      |                    Owner:  (none)
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:  invalid
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
Changes (by James):

 * status:  new => closed
 * resolution:   => invalid


 > I get the stupid error:
 > {{{
 > width not divisible by 2 (453x800)
 > }}}
 That "stupid error" is libx264 not accepting the input stream it's being
 fed. The scale filter can't know what the encoder down the line in the
 process can handle, and is doing exactly what you told it to do.
 You want it to force the dimensions to be divisible by 2? Then check the
 documentation for the scale filter in https://ffmpeg.org/ffmpeg-
 filters.html#scale and you will find this option coincidentally called
 "force_divisible_by". You can also find it if you look at the available
 options in the CLI by running

 ffmpeg -h filter=scale

 With a description that states:
 > enforce that the output resolution is divisible by a defined integer
 when force_original_aspect_ratio is used (from 1 to 256) (default 1)
Ticket URL: <https://trac.ffmpeg.org/ticket/10279#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list