I am currently using the command from this question to crossfade two videos:
ffmpeg -i firstVideo.mp4 -i secondVideo.mp4 -f lavfi -i color=black - filter_complex \ "[0:v]format=pix_fmts=yuva420p,fade=t=out:st=4:d=1:alpha=1,setpts=PTS-STARTPTS[va0];\ [1:v]format=pix_fmts=yuva420p,fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS+4/TB[va1];\ [2:v]scale=640x360,trim=duration=9[over];\ [over][va0]overlay[over1];\ [over1][va1]overlay=format=yuv420[outv]" \ -vcodec libx264 -map [outv] output.mp4
This crossfade animation works fine, except for it shrinks the video to 480x360 instead of the desired 640x360. The meta information will falsely show that the dimensions are 640x360, but I am certain they are not.
I am also certain that both input videos are exactly 640x360.
I am guessing that the shrinking is due to the pixel format
yuva420p, but I'm not sure what other options I have. I have tried changing the pixel format but nothing has worked so far.
The command given above runs without any errors.