ffmpeg png sequence to mov

Assuming frames are named

0001.png
0002.png
0003.png
0004.png
0005.png

then this should do the trick

ffmpeg -i %04d.png -c:v prores -pix_fmt yuv422p -an -r 25 tetris9.mov

Cropping (keeping bottom part) from 1920x1200 to 1920x1080 ( 1200 - 1080 = 120 )

ffmpeg -i %04d.png -filter:v "crop=1920:1080:0:120" -c:v prores -pix_fmt yuv422p -an -r 25 tetris9_1080p.mov -y

pingpong N times

ffmpeg -i tetris9_1080p.mov -filter_complex "[0]reverse[r];[0][r]concat,loop=2:6250,setpts=N/25/TB" -c:v prores tetris9_1080p_3x.mov
# In loop=2:6250, 6250 is framerate (25) x length of input clip (250 frames in this case)

Note

loop=1 will do ping-pong-ping-pong
loop=2 will do ping-pong-ping-pong-ping-pong

That number (6250) could also be calculated automagically

dur="$(mediainfo "--Inform=Video;%FrameCount%" tetris9_1080p.mov)"
num=$(( dur * 25 ))
echo $num
about / github / jekyll

Support this neat blog by sending some doge to this dogecoin deposit address (minimum is 10 doge): D7hVsZVDVEqrLUEmkQF84FZRjZEKDmr5oL