-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.sh
More file actions
41 lines (31 loc) · 1.08 KB
/
entrypoint.sh
File metadata and controls
41 lines (31 loc) · 1.08 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
#!/bin/sh
INPUT_DIR="/app/input"
OUTPUT_DIR="/app/output"
mkdir -p "$OUTPUT_DIR"
VIDEO_EXTENSIONS="mp4 mkv avi mov wmv"
find "$INPUT_DIR" -type f | while read -r video_file; do
extension=$(echo "$video_file" | awk -F. '{print tolower($NF)}')
is_video=false
for ext in $VIDEO_EXTENSIONS; do
if [ "$extension" = "$ext" ]; then
is_video=true
break
fi
done
if [ "$is_video" = true ]; then
video_name=$(basename "$video_file" | sed "s/\.[^.]*$//")
output_path="$OUTPUT_DIR/$video_name"
mkdir -p "$output_path"
if [ ! -f "$output_path/001.jpg" ]; then
echo "Processing: $video_file"
echo "Output: $output_path"
python video2slide_extractor.py "$video_file" "$output_path"
echo "Done: $video_file"
echo "------------------------"
else
echo "Skipped: $video_file (Already processed)"
echo "------------------------"
fi
fi
done
echo "All processes are completed"