0

i have an problem with ffmpeg. i would like to format a image sequence into a video. I use the followed command for this:

ffmpeg -framerate 24 -i image%04d.jpeg Project.mp4 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2"

i have 4 pictures:

  • image0001.jpeg
  • image0002.jpeg
  • image0003.jpeg
  • image0004.jpeg

With this command, i get the following error:

[libx264 @ 000001f12e7a0540] height not divisible by 2 (1200x1599) 
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe 
incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Can someone tell me why this mistake comes and how can I fix it?

Thanks

iSaBo
  • 157
  • 1
  • 2
  • 16

1 Answers1

3

Option placement matters:

ffmpeg [input options] -i input [output options] output

Any trailing options (ones after the output), such as your -vf, may be ignored.

Corrected command:

ffmpeg -framerate 24 -i image%04d.jpeg -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" Project.mp4
llogan
  • 121,796
  • 28
  • 232
  • 243
  • When outputting MP4 from images it is recommended add the format filter to set a widely compatible chroma subsampling: `ffmpeg -framerate 24 -i image%04d.jpeg -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2,format=yuv420p" Project.mp4` – llogan Sep 27 '19 at 17:26