Zend certified PHP/Magento developer

FFMPEG color overlay produces scrubbing/time navigation issue

I am trying to make a command that will blank video to a black screen for a specified period of time, to use in a video editing script. I have a version that will work with a black image file, but I am trying to do it with without needing the extra file. I have put together a version of the command that mostly works- using lavfi color generation, but presents an odd problem: whenever the video is fast forwarded, scrubbed, or otherwise time-navigated in a manner other than just watching it, the audio cuts out. The overlay visually works properly. If I just play the video from beginning to end, the audio works fine. The audio only cuts out if I try to jump around in the video in any manner.

I did play around with setpts for the video filtering a little, because I have a vague, uneducated feeling this is a timecode or a/v sync issue. I am not including what I tried with that because I have little confidence in the manner in which I tried it being correct. I am relatively new to ffmpeg and don’t have a great understanding of the deeper workings of timecode or a/v stream sync.

Here is the image file version of my overlay command that doesn’t produce this issue that I am currently using:

ffmpeg.exe -nostdin -i "input.mkv" -i "overlay.jpg" -filter_complex "[0:v][1:v]overlay=enable='between(t,60,120)'[1V]" -map [1V] -map 0:a -map 0:s -c:v libx264 -crf 18 -c:a copy -c:s copy "output.mkv"

Here is the lavfi color version of my overlay command that produces the issue that I want to get working:

ffmpeg.exe -nostdin -i "input.mkv" -f lavfi -i "color=color=black:size=720x480:rate=(24000/1001)" -filter_complex "[0:v][1:v]overlay=shortest=1:enable='between(t,60,120)'[1V]" -map [1V] -map 0:a -map 0:s -c:v libx264 -crf 18 -c:a copy -c:s copy "output.mkv"

I am trying to avoid directly filtering the audio because I want the script to be able to handle a variable number of audio streams without having to account for them individually. If I do need to do something with my audio streams, could you please indicate an answer that can filter all the audio streams from the input video at once (if that’s even possible).

This is my first post to a forum like this, so please forgive any mistakes in how these questions are normally posted. Thank you for any help offered.