c3tracker:scripts

export VOC_WORKSPACE=~/voc
export VOC_CUTTING_TOOL=shotcut

function voc_check() {
	if [ -z "$0" ]; then
		echo "usage: ${FUNCNAME[0]} ID"
		return 1
	fi
	if [ ! -L "$VOC_WORKSPACE/check" ]; then
		echo "run voc_eventprep first!"
		return 1
	fi
	cd ~/voc
	mpv "check/${1}-hd.mp4"
	cd -
}

function voc_cut() {
    if [ -z "$0" ]; then
        echo "usage: ${FUNCNAME[0]} ID"
        return 1
    fi
    if [ ! -L "$VOC_WORKSPACE/cut" ]; then
        echo "run voc_eventprep first!"
        return 1
    fi
    cd ~/voc
    case "$VOC_CUTTING_TOOL" in
        shotcut)
            cp cut/**/${1}/project_shotcut.mlt /tmp
            ln -vs "$(realpath cut/**/${1}/uncut.ts)" /tmp
            shotcut /tmp/project_shotcut.mlt
            rm /tmp/uncut.ts
            cp /tmp/project_shotcut.mlt cut/**/${1}/
            rm /tmp/project_shotcut.mlt
            ;;
        kdenlive)
            kdenlive cut/**/${1}/project.kdenlive
            ;;
        *)
            cd -
            echo "invalid cutting tool configured"
            return 1
    esac
    cat cut/**/${1}/*frame
    cd -
}

function voc_eventprep() {
	if [ -z "$1" ]; then
		echo "usage: ${FUNCNAME[0]} acronym"
		return 1
	fi
	if [ ! -d "$VOC_WORKSPACE" ]; then
		mkdir -p "$VOC_WORKSPACE"
	fi
	rm -f ~/voc/{cut,check}
	ln -s "/video/fuse/$1" ~/voc/cut
	ln -s "/video/encoded/$1" ~/voc/check
}

function voc_mount() {
	if [ ! -d "/video" ]; then
		echo "/video missing, please create"
		return 1
	fi
	sudo mount -t cifs //storage.lan.c3voc.de/video /video -o password=dummy -o uid=$UID
	sudo mount -t cifs //storage.lan.c3voc.de/fuse /video/fuse -o password=dummy -o uid=$UID
}
  • c3tracker/scripts.txt
  • Last modified: 2022/02/27 13:45
  • by andi