-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquality_test
More file actions
62 lines (54 loc) · 1.73 KB
/
Copy pathquality_test
File metadata and controls
62 lines (54 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# --- Configuration ---
FFMPEG="/usr/lib/jellyfin-ffmpeg/ffmpeg"
DEVICE="/dev/dri/renderD128"
INPUT="$1"
if [[ -z "$INPUT" ]]; then
echo "Usage: $0 <input_file>"
exit 1
fi
# Function to run a test case with full logging
run_test() {
local SUFFIX=$1
local PRESET=$2
local LA=$3
local OUTPUT="test_${SUFFIX}.mkv"
local LOG="test_${SUFFIX}.log"
echo "----------------------------------------------------"
echo "RUNNING TEST: $SUFFIX"
echo "Preset: $PRESET | Look-Ahead: $LA"
echo "Log file: $LOG"
echo "----------------------------------------------------"
# 1. We use -loglevel debug to see every internal QSV decision
# 2. We redirect both stdout and stderr (2>&1) to the log file
$FFMPEG -hide_banner -loglevel debug -y \
-hwaccel qsv -qsv_device "$DEVICE" -hwaccel_output_format qsv \
-i "$INPUT" \
-c:v av1_qsv \
-preset "$PRESET" \
-global_quality:v 28 \
-extbrc 1 \
-look_ahead "$LA" \
-look_ahead_depth 40 \
-extra_hw_frames 40 \
-b_strategy 1 \
-bf 7 \
-low_power 0 \
-c:a copy \
-frames:v 500 \
"$OUTPUT" > "$LOG" 2>&1
# Print the specific line we are looking for to the console for a quick status check
grep -i "RateControlMethod" "$LOG" | head -n 1
}
# --- Test Cases ---
# Note: -frames:v 500 is added so the tests finish quickly
run_test "P7_noLA" "7" "0"
run_test "P7_withLA" "7" "1"
run_test "P3_noLA" "3" "0"
run_test "P3_withLA" "3" "1"
echo ""
echo "******************************************"
echo "TEST COMPLETE"
echo "Full logs available in this directory (.log files)"
ls -lh test_*.mkv test_*.log
echo "******************************************"