]> git.plutz.net Git - serve0/blob - actions/transcode.sh
transcoding option for additional resolutions
[serve0] / actions / transcode.sh
1 #!/bin/zsh
2
3 info="$_GET[\"i\"]"
4 target="$_GET[\"t\"]"
5 video="${_DATA}/videos/$info"
6 meta="${_DATA}/meta/$info.meta"
7 trans="${_DATA}/transcoded/${info}.${target}p.webm"
8
9 head -n1 "$meta" |read length width height name
10
11 twidth=$(($width * $target / $height))
12
13 [ -f "$target" ] || nohup avconv -i "$video" -s "${twidth}x${target}" "$trans" &
14
15 echo "Location: transcoded/${info}.${target}p.webm"
16 echo