Both videos are being combined into a single video. Your output only has one video stream, so -shortest
does nothing because it has no other streams to compare duration.
Use the overlay specific shortest
option instead:
ffmpeg -i "D:Underlay.avi" -i "D:Overlay.avi" -filter_complex "[1:v]colorkey=0xFFFFFF:0.01:0.0[KeyedOverlay];[0:v][KeyedOverlay]overlay=shortest=1:format=auto[Composite]" -map "[Composite]" -c:v png "D:Composite.avi"
I also added format=auto
so your overlay may look better.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…