Okay, so my problem is definitely caused by "missing key frames".
So, to fix it, I now do it in two stages:
(Note that the original source timestamp I want to cut from is 35:58.907
):
# Move forward the cutting timestamp by N seconds. Here, N=6.00
ffmpeg -ss 35:52.907 -i Source.mkv \
-copyts -to 36:43.857 -map 0:0 -map 0:2 \
-c:v libx264 -preset slow -tune film -crf 18 -vf "ass=Source.ass" \
-c:a copy Intermediate.mkv
This step produces several seconds of black frames at the beginning, but it does have the section I want to cut from properly. Then I follow up with:
# Re-cut the video starting N seconds forward. Here, N=6.00
ffmpeg -i Intermediate.mkv -ss 00:06.000 \
-c:v libx264 -preset slow -tune film -crf 18 \
-c:a copy Destination.mkv
Yes, I have to encode the video twice, so there would be some degradation, but visually I see no degradation, so I think this two-step processing is acceptable for my needs.
(And if visual artifacts start appearing, I can use a much lower -crf
for the first step, say 15
, or 12
, or -- God forbid -- even 0
if need be.)
-copyts
; however, I cannot prove my theory because in my setup(s), everything works flawlessly.