From f817cb0f4c07788a2c114590fd317c94c9a3958c Mon Sep 17 00:00:00 2001 From: Antti Ajanki Date: Wed, 25 Aug 2010 20:13:45 +0300 Subject: call a script after downloading finishes --- examples/transcode2ogg.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 examples/transcode2ogg.sh (limited to 'examples') diff --git a/examples/transcode2ogg.sh b/examples/transcode2ogg.sh new file mode 100755 index 0000000..3f25ffc --- /dev/null +++ b/examples/transcode2ogg.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# An example post-processing script for VDR plugin webvideo. +# +# Copyright: Antti Ajanki +# License: GPL3, see the file COPYING for the full license +# +# This script transcodes a video file using Ogg Theora and Vorbis +# codecs. The first parameter is the name of the video file. +# +# To setup this script to be called for every downloaded file, start +# the webvideo plugin with option -p. For example: +# +# vdr -P "webvideo -p /path/to/this/file/transcode2ogg.sh" + +fullsrcname=$1 +videodir=`dirname "$fullsrcname"` +srcfile=`basename "$fullsrcname"` +srcbasename=`echo "$srcfile" | sed 's/\.[^.]*$//'` +destname="$videodir/$srcbasename.ogg" + +ffmpeg -i "$fullsrcname" -qscale 8 -vcodec libtheora -acodec libvorbis -ac 2 -y "$destname" + +if [ $? -eq 0 ]; then + rm -f "$fullsrcname" + exit 0 +else + exit 1 +fi -- cgit v1.2.3