0

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/

Viktor
  • 9
  • 2
  • Show the full log. Your audio should be five seconds. And video, three. – Gyan Oct 12 '17 at 05:31
  • I just tried this with the older ffmpeg-20161122-d316b21-win64-static and it did not hang this time. Plus the "missing picture in access unit" error messages went away. – Viktor Oct 12 '17 at 23:47
  • It produces a 3 second video with 3 second audio using the old code. The new code hangs and I can exit by doing four ctrl-c's. If I try to paste the log here, the web site says it is too long. – Viktor Oct 18 '17 at 18:12
  • I posted a defect for this at https://trac.ffmpeg.org/ticket/6798 – Viktor Nov 03 '17 at 23:27
  • They have fixed the problem in the latest version. – Viktor Feb 02 '18 at 22:10

0 Answers0