I'm totally new to ffmpeg and video conversion in general and I need instructions on how to batch process a bunch of files, so my doubt is:

Is there a way to concatenate FileA.mp4 + xfade FileA2.mp4 + Fade Out?

The first file usually has 30 seconds while the second is 10 seconds long.

Can the concatenation above process an entire folder consisting of hundreds of files like:

FileA.mp4+FileA2.mp4 = FileA.mp4
FileB.mp4+FileB2.mp4 = FileB.mp4
FileC.mp4+FileC2.mp4 = FileC.mp4

And, how could I choose the ouput folder for the output.mp4 files?