Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vplay #841

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions vplay
Original file line number Diff line number Diff line change
@@ -0,0 +1,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"