#!/bin/bash

# Check for the input file
if [ -z "$1" ]; then
    echo "Please provide an input video file."
    exit 1
fi

# If the slowdown factor is not provided, default to 2 (e.g., half the speed).
FACTOR=${2:-2}

DIR=$(dirname "$1")
FN=$(basename "$1")

# Use the setpts filter to slow down the video
ffmpeg -i "$1" -vf "setpts=$FACTOR*PTS" -an "$DIR/SD_$FN"

