diff options
author | Antti Ajanki <antti.ajanki@iki.fi> | 2010-08-25 20:13:45 +0300 |
---|---|---|
committer | Antti Ajanki <antti.ajanki@iki.fi> | 2010-08-25 20:13:45 +0300 |
commit | f817cb0f4c07788a2c114590fd317c94c9a3958c (patch) | |
tree | 7acfc743cb19218e48f25a158c842b457ba7bfd9 /examples | |
parent | 8ceffe4de296a21ad841a865315ca1d1370777c9 (diff) | |
download | vdr-plugin-webvideo-f817cb0f4c07788a2c114590fd317c94c9a3958c.tar.gz vdr-plugin-webvideo-f817cb0f4c07788a2c114590fd317c94c9a3958c.tar.bz2 |
call a script after downloading finishes
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/transcode2ogg.sh | 29 |
1 files changed, 29 insertions, 0 deletions
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 <antti.ajanki@iki.fi> +# 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 |