I copied this command ffmpeg -framerate 1/5 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
from https://trac.ffmpeg.org/wiki/Slideshow but everytime I run it I get the error of:
"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"
And if I move the output like this: ffmpeg -framerate 1/5 -i img%03d.png out.mp4 -c:v libx264 -r 30 -pix_fmt yuv420p
then a video is created, it say 5-10 seconds, but the progress bar does not move and it is just black.
I've also looked at How to create a video from images with FFmpeg? but I basically get the same results.
Is there anything that I'm missing? Any feedback would be appreciated, thanks.
Full message:
int(1) array(21) { [0]=> string(79) "ffmpeg version 4.3.1-0york0~18.04 Copyright
(c) 2000-2020 the FFmpeg developers" [1]=> string(48) " built with gcc 7 (Ubuntu
7.5.0-3ubuntu1~18.04)" [2]=> string(1280) " configuration: --prefix=/usr --extra-
version='0york0~18.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --
incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-
stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-
ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --
enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-
libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-
libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-
libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-
librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-
libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --
enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --
enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-
libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-
omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-
libzimg --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-
libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-
shared" [3]=> string(40) " libavutil 56. 51.100 / 56. 51.100" [4]=> string(40) "
libavcodec 58. 91.100 / 58. 91.100" [5]=> string(40) " libavformat 58. 45.100 /
58. 45.100" [6]=> string(40) " libavdevice 58. 10.100 / 58. 10.100" [7]=>
string(40) " libavfilter 7. 85.100 / 7. 85.100" [8]=> string(40) " libavresample
4. 0. 0 / 4. 0. 0" [9]=> string(40) " libswscale 5. 7.100 / 5. 7.100" [10]=>
string(40) " libswresample 3. 7.100 / 3. 7.100" [11]=> string(40) " libpostproc
55. 7.100 / 55. 7.100" [12]=> string(37) "Input #0, image2, from 'img%03d.png':"
[13]=> string(54) " Duration: 00:00:10.00, start: 0.000000, bitrate: N/A" [14]=>
string(76) " Stream #0:0: Video: png, rgba(pc), 361x363, 0.20 tbr, 0.20 tbn, 0.20
tbc" [15]=> string(15) "Stream mapping:" [16]=> string(54) " Stream #0:0 -> #0:0
(png (native) -> h264 (libx264))" [17]=> string(31) "Press [q] to stop, [?] for
help" [18]=> string(61) "[libx264 @ 0x55b5d0189c80] width not divisible by 2
(361x363)" [19]=> string(159) "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" [20]=> string(18) "Conversion failed!" }