-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathtest-fixed-config.sh
More file actions
executable file
Β·56 lines (44 loc) Β· 1.76 KB
/
test-fixed-config.sh
File metadata and controls
executable file
Β·56 lines (44 loc) Β· 1.76 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
#!/bin/bash
echo "π§ͺ Testing fixed FFmpeg configuration..."
# Test the new configuration that should eliminate stuttering
echo "πΉ Recording 10 seconds with optimized settings..."
# Use lavfi sources instead of x11grab for testing
ffmpeg -f lavfi -i "color=c=blue:size=1280x720:duration=10" \
-f lavfi -i "sine=frequency=1000:duration=10" \
-c:v libx264 -preset ultrafast -crf 32 \
-profile:v baseline -level 3.0 -pix_fmt yuv420p \
-threads 1 -tune zerolatency -g 30 -keyint_min 30 \
-bf 0 -refs 1 \
-c:a aac -b:a 128k \
-t 10 -y test_fixed.mp4 2>&1 | grep -E "(frame=|fps=|speed=|error)"
echo "β
Recording completed. Analyzing results..."
# Analyze the generated video
echo "π Analyzing the generated video..."
ffprobe -v quiet -show_entries stream=codec_name,profile,level,has_b_frames,refs,bit_rate -of csv test_fixed.mp4
echo "π Video analysis:"
echo "=================="
# Check if B-frames are disabled
if ffprobe -v quiet -show_entries stream=has_b_frames -of csv test_fixed.mp4 | grep -q ",0"; then
echo "β
B-frames successfully disabled"
else
echo "β B-frames still present"
fi
# Check profile
if ffprobe -v quiet -show_entries stream=profile -of csv test_fixed.mp4 | grep -q "baseline"; then
echo "β
Baseline profile applied"
else
echo "β Wrong profile detected"
fi
# Check level
if ffprobe -v quiet -show_entries stream=level -of csv test_fixed.mp4 | grep -q "30"; then
echo "β
Level 3.0 applied"
else
echo "β Wrong level detected"
fi
# Check file size
size=$(stat -f%z test_fixed.mp4 2>/dev/null || stat -c%s test_fixed.mp4 2>/dev/null)
size_mb=$(echo "scale=2; $size / 1024 / 1024" | bc -l 2>/dev/null || echo "unknown")
echo "π File size: ${size_mb}MB"
# Cleanup
rm -f test_fixed.mp4
echo "β
Test completed!"