Vidold

Shell Script Uploaded Feb 16, 2026 by pagetelegram 2 views 959 B
BASH Scripts
SH vidold.sh
#!/bin/bash

# Improved Bash script for converting to Sorenson Video 1 (SVQ1) .mov
# at max height 480p (preserving aspect ratio), padded to even dimensions,
# 24 fps. This avoids the "Padded dimensions cannot be smaller..." error
# by scaling slightly smaller when necessary.

for input in "$@"; do
    if [[ ! -f "$input" ]]; then
        echo "File not found: $input"
        continue
    fi

    output="${input%.*}.mov"

    echo "Converting $input to $output (Sorenson Video 1 ~480p, 24 fps)..."

    ffmpeg -i "$input" \
        -vf "scale=854:480:force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2,pad=854:480:(854-iw)/2:(480-ih)/2:black,fps=24,format=yuv420p" \
        -c:v svq1 \
        -q:v 2 \
        -c:a pcm_s16be \
        -ar 44100 \
        -r 24 \
        "$output"

    if [[ $? -eq 0 ]]; then
        echo "Done: $output"
    else
        echo "Error converting $input"
    fi
done

echo "All conversions finished."
Download SH

← Back to SH