I have a toolchain that produces frames that are usually 1920x1080, but occasionally 1919x1080 or 1920x1079. (Yes, this is a bug. Please read on.) When ffmpeg encodes a video from it, with a command like
ffmpeg -y -r 30 -i foo/%04d.png -vcodec h264 out.mp4
then it prints remarks like
Input stream #0:0 frame changed from size:1919x1080 fmt:rgb24 to size:1920x1080 fmt:rgb24
but those frames, rather than being resized and included in out.mp4
, are omitted from out.mp4
.
Can those frames be included? I found no mention of nonconstant frame size on forums and in documentation, but ffmpeg itself here claims to resize the frame. (The remark is printed at line 1688 of ffmpeg.c. There, a flag resample_changed
is set, which causes the width and height fields of InputStream *ist
to be corrected.)
David Elliman may be reporting similar behavior in an answer to https://stackoverflow.com/questions/18043841/ffmpeg-missing-image-frames-in-generated-video-from-images?rq=1 .