Zend certified PHP/Magento developer

FFmpeg only exports audio and not video

I’m using the following FFmpeg script to cut part of video and save it:

#!/bin/bash

# Input parameters
input_video=$1
start_time=$2
end_time=$3
output_video=$4

# Calculate duration
duration=$(echo "$end_time - $start_time" | bc)

# Use ffmpeg to cut the video
ffmpeg -y -i "$input_video" -ss "$start_time" -t "$duration" -c copy "$output_video"

The problem is, that for durations shorter than ~4s, only the audio gets exported. I couldn’t find anything about that issue on the internet and BingAi also didn’t find anything usefull.

The videos I’m cutting are default mp4, 1920X1080, 60fps OBS screen recordings.

Does anyone know how to fix that?

Note, that in practice I’m only using the last line of that code. Export the last line to .bat file with Wolfram Mathematica and then run that .bat file also from Mathematica (latest version of Mathematica, latest version of Windows). It’s probably not relevant for this issue, but I wrote it just in case.