I was trying to crossfade a larger number of videos by doing two at a time using the solution in Crossfading Video AND Audio with ffmpeg However, the fade seems to produce video files which create errors in subsequent processing of them. I was trying various experiments to try to work around the problem. One of the attempts I tired makes ffmpeg stop with an apparent infinite loop. So I simplified the example to take a 3 second video and fade video's center second with itself, which should produce essentially the same video. It didn't however. So I am not sure if I missed some important parameter. But I would not expect ffmpeg to get stuck in any case. The three steps in Windows using ffmpeg-20170921-183fd30-win64-static.zip are:
ffmpeg.exe -y -i videofromCanoncamcorder.MTS -ss 28.5 -t 3 -vcodec libx265 -x265-params -o tail.m2t -report
copy tail.m2t head.m2t
ffmpeg -y -i tail.m2t -i head.m2t -an -filter_complex "[0:v]trim=start=0:end=1,setpts=PTS-STARTPTS[firstclip];[1:v]trim=start=2,setpts=PTS-STARTPTS[secondclip];[0:v]trim=start=1:end=2,setpts=PTS-STARTPTS[fadeoutsrc];[1:v]trim=start=1:end=2,setpts=PTS-STARTPTS[fadeinsrc];[fadeinsrc]format=pix_fmts=yuva420p,fade=t=in:st=0:d=1:alpha=1[fadein];[fadeoutsrc]format=pix_fmts=yuva420p,fade=t=out:st=0:d=1:alpha=1[fadeout];[fadein]fifo[fadeinfifo];[fadeout]fifo[fadeoutfifo];[fadeoutfifo][fadeinfifo]overlay[crossfade];[firstclip][crossfade][secondclip]concat=n=3[output];[0:a][1:a] acrossfade=d=1 [audio]" -map "[output]" -map "[audio]" fade.m2t -report
The log files, data files and command file can be found here: http://berstis.com/ffmpegbug/