#!/bin/bash

IN="TIDElab-20260713-020001.mp4"
OUT="2am.5x.mp4"

echo "Input file: $IN"

DURATION=$(
    ffprobe -v error \
      -show_entries format=duration \
      -of default=noprint_wrappers=1:nokey=1 \
      "$IN"
)

printf "Original length: %.3f seconds\n" "$DURATION"
printf "5x length:       %.3f seconds\n" "$(awk "BEGIN {print $DURATION / 5}")"

ffmpeg -y \
  -i "$IN" \
  -vf "setpts=PTS/5" \
  -an \
  -c:v libx264 \
  -preset veryfast \
  -crf 18 \
  -movflags +faststart \
  "$OUT"

echo "Created: $OUT"
