log is done

This commit is contained in:
2024-01-12 19:44:09 -06:00
parent 5bf1bb0c17
commit 0523a28e49
3 changed files with 11 additions and 8 deletions

1
.gitignore vendored
View File

@@ -2,4 +2,5 @@ ffmpeg/
rav1e/ rav1e/
svt/ svt/
aom/ aom/
vmaf/
benchmark/ benchmark/

View File

@@ -18,17 +18,16 @@ test -f "$INPUT_DIR/${INPUT[2]}" || wget -O "$INPUT_DIR/${INPUT[2]}" 'https://ww
rm -rf "$OUTPUT_DIR" && mkdir -p "$OUTPUT_DIR" rm -rf "$OUTPUT_DIR" && mkdir -p "$OUTPUT_DIR"
# Different variables to test # Different variables to test
CRF=(40) CRF=(20 25 30)
ENCODER=('libsvtav1' 'librav1e' 'libaom-av1') ENCODER=('libsvtav1' 'librav1e' 'libaom-av1')
ENCODER=('libsvtav1') PRESET=(4 8 12)
PRESET=(13)
# Log for results # Log for results
LOG="$OUTPUT_DIR/results.txt" LOG="$OUTPUT_DIR/results.txt"
VMAF_RESULTS="$OUTPUT_DIR/vmaf.json"
for input in "${INPUT[@]}" for input in "${INPUT[@]}"
do do
# echo "$input"
for encoder in "${ENCODER[@]}" for encoder in "${ENCODER[@]}"
do do
for preset in "${PRESET[@]}" for preset in "${PRESET[@]}"
@@ -38,11 +37,14 @@ do
OUTPUT="$OUTPUT_DIR/${encoder}_preset${preset}_crf${crf}_$input" OUTPUT="$OUTPUT_DIR/${encoder}_preset${preset}_crf${crf}_$input"
echo "output: $OUTPUT" >> "$LOG" echo "output: $OUTPUT" >> "$LOG"
TIME_BEFORE=$(date +%s) TIME_BEFORE=$(date +%s)
ffmpeg -i "$INPUT_DIR/$input" -c:a copy -c:v "$encoder" -preset "$preset" -crf "$crf" "$OUTPUT" 2> /dev/null || exit 1 ffmpeg -i "$INPUT_DIR/$input" -c:a copy -c:v "$encoder" \
-preset "$preset" -crf "$crf" "$OUTPUT" 2> /dev/null || exit 1
TIME_AFTER=$(date +%s) TIME_AFTER=$(date +%s)
TIME_DIFF=$((TIME_AFTER - TIME_BEFORE)) TIME_DIFF=$((TIME_AFTER - TIME_BEFORE))
echo -e "\t time taken: $TIME_DIFF" >> "$LOG" echo -e "\t time taken: $TIME_DIFF seconds" >> "$LOG"
ffmpeg -i "$OUTPUT" -i "$INPUT_DIR/$input" -lavfi libvmaf=n_threads="$(nproc)" -f 'null' - | grep "VMAF score:" >> "$LOG" || exit 1 ffmpeg -an -sn -i "$OUTPUT" -i "$INPUT_DIR/$input" -lavfi \
libvmaf=n_threads="$(nproc)":log_path="$VMAF_RESULTS":log_fmt='json' -f 'null' -
echo -e "\t mean vmaf: $(cat "$VMAF_RESULTS" | jq '.pooled_metrics.vmaf.mean')" >> "$LOG" || exit 1
done done
done done
done done

View File

@@ -6,7 +6,7 @@ sudo apt-get install autoconf automake build-essential cmake git-core \
libass-dev libfreetype6-dev libsdl2-dev libtool libva-dev libvdpau-dev \ libass-dev libfreetype6-dev libsdl2-dev libtool libva-dev libvdpau-dev \
libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config \ libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config \
texinfo wget zlib1g-dev nasm yasm libssl-dev time python3 meson ninja-build\ texinfo wget zlib1g-dev nasm yasm libssl-dev time python3 meson ninja-build\
doxygen xxd -y || exit 1 doxygen xxd jq -y || exit 1
curl https://sh.rustup.rs -sSf | sh -s -- -y curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env" source "$HOME/.cargo/env"