Zend certified PHP/Magento developer

ffmpeg cut, fade and concat causes the video to get stuck

I’m trying to add “fade out” effect to a long video. One method I explored is cutting video at the end before few seconds, adding the fade out effect to the second split and concat both the splits.

I came up with below commands.

:: Cut the video into 2
ffmpeg -i myvideo.mp4 -c copy -map 0 -segment_time 00:00:40 -f segment -reset_timestamps 1 -y "split%%01d.mp4"

:: Add the fade out effect
ffmpeg -i split1.mp4 -vf "fade=t=out:st=5:color=red" split1-m.mp4 -y

:: Merge them without re-encoding
ffmpeg -safe 0 -f concat -i videolist.txt -c copy splitcombine.mp4 -y

When I play the combined video in Chrome, the video is stuck at the join. In VLC, there is a blank stutter.

(in Chrome video player video is stuck at the join. If I resume the video, it ends)

(in VLC)

resume

If I remove the “fade out” effect and simply combine, there is no issue. (left no fade out effect. right with fade effect)

Split without fade out effect
Split with fade out effect

I’m not sure what is the issue here.

Any ideas would be greatly helpful! Any other ideas to achieve the similar result is also welcomed!