Created
May 4, 2023 13:14
-
-
Save tebriel/9beb1ebe34d4a0d95fe1dd179069b170 to your computer and use it in GitHub Desktop.
Script to convert .vc1 files using ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
FILENAME=${1?"Must specify filename"} | |
OUTPUT=${2?"Must specify output file"} | |
TYPE=$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "${FILENAME}") | |
if [ "${TYPE}" == "vc1" ]; then | |
echo "converting ${FILENAME} it's ${TYPE}" | |
ffmpeg -i "${FILENAME}" -c:v hevc -preset slow -crf 25 -tag:v hvc1 -q:a 100 "${FILENAME%.*}.x265.mp4" | |
exitcode=$? | |
if [ "${exitcode}" -neq 0 ]; then | |
echo "${FILENAME}: FAILED" >> "${OUTPUT}" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment