twidth=$(($width * $target / $height))
-[ -f "$target" ] || nohup avconv -i "$video" -s "${twidth}x${target}" "$trans" &
+[ -f "$target" ] || nohup avconv -i "$video" -s "${twidth}x${target}" -threads auto "$trans" &
-echo "Location: transcoded/${info}.${target}p.webm"
+echo "Location: /transcoded/${info}.${target}p.webm"
echo
minutes="$(($length / 60)):$(($length % 60))"
linkinfo="$(urlsave "$info")"
+
+ [ $height -gt 480 ] && \
+ alt480="<a class=\"videolink alt 480p\" href=\"?action=transcode&i=${linkinfo}&t=480\">480p</a>" || unset alt480
+ [ $height -gt 240 ] && \
+ alt240="<a class=\"videolink alt 240p\" href=\"?action=transcode&i=${linkinfo}&t=240\">240p</a>" || unset alt240
+
tee "$cache" <<VIDEOend
<li class="thumb">
<a class="watchlink" name="${linkinfo}" href="?action=watch&i=${linkinfo}">
<img src="$thumb">
</a>
<a class="videolink" href="$video">$info</a>
+ ${alt480} ${alt320} ${$alt240}
<!-- a href="$reenc">VP8</a -->
- <!-- a class="videolink fake-mp4" href="$mpfake">fake-mp4</a --
- <a class="videolink" href="?action=transcode&i=${linkinfo}&t=480">480p</a>
- <a class="videolink" href="?action=transcode&i=${linkinfo}&t=240">240p</a>
+ <!-- a class="videolink fake-mp4" href="$mpfake">fake-mp4</a -->
+
<input type="checkbox" name="tagsel" value="$info">
<span class="info property">${minutes}min</span>
<span class="info property">${width}x${height}</span>