diff options
author | Marcin Chrzanowski <m@m-chrzan.xyz> | 2023-03-26 13:49:36 +0200 |
---|---|---|
committer | Marcin Chrzanowski <m@m-chrzan.xyz> | 2023-03-26 13:49:36 +0200 |
commit | 355d4996dc32988aabe000fbfaa1a9bbdd9ec585 (patch) | |
tree | f4af7671f8ed4fd9138d5fe5a723b64046de456f /mpvl | |
parent | 2a5b14312110abee3a70a2f59a8deacd6929031a (diff) |
Add initial scripts
Diffstat (limited to 'mpvl')
-rwxr-xr-x | mpvl | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +#!/bin/bash + +# Starts a media file in mpv looped. +# USAGE: mpvl [<start> <stop>] <file> +# If only `file` given, loops the whole file. +# If `start` and `stop` given, loops the section between those timecodes. + +FLAGS= +FILE= + +if [ "$#" -eq 3 ]; then + FLAGS="--start=$1 --ab-loop-a=$1 --ab-loop-b=$2" + FILE=$3 +elif [ "$#" -eq 1 ]; then + FLAGS=--loop + FILE=$1 +else + echo "USAGE: mpvl [<start> <stop>] <file>"; + exit 1; +fi + +mpv $FLAGS "$FILE" |