forked from amiaopensource/vrecord
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvplay
More file actions
executable file
·36 lines (29 loc) · 834 Bytes
/
vplay
File metadata and controls
executable file
·36 lines (29 loc) · 834 Bytes
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
#!/bin/bash
# vplay: a script to play back digitized video files with vrecord visualizations
# Ensure a file is passed as an argument
if [ -z "$1" ]; then
echo "Usage: vplay [video file]"
exit 1
fi
# Path to the Lua script
RESOURCE_PATH="$(dirname "$0")/Resources"
LUA_SCRIPT="${RESOURCE_PATH}/qcview.lua"
# Check if the file exists
VIDEO_FILE="$1"
if [ ! -f "$VIDEO_FILE" ]; then
echo "Error: File '$VIDEO_FILE' not found."
exit 1
fi
# Check if mpv is installed
if ! command -v mpv &> /dev/null; then
echo "Error: mpv is not installed. Please install mpv."
exit 1
fi
# mpv options
MPVOPTS=(--no-osc)
MPVOPTS+=(--load-scripts=no)
MPVOPTS+=(--script="$LUA_SCRIPT")
MPVOPTS+=(--really-quiet)
MPVOPTS+=(--title="vplay - $(basename "$VIDEO_FILE")")
# Play the file with visualizations
mpv "${MPVOPTS[@]}" "$VIDEO_FILE"