install wiki-plugins/wikiplugin_flowplayer from mods.tiki.org
create high quality flv using mencoder, add metadata using flvtool2, and generate preview image using ffmpeg:
[+]
Copy to clipboard
#!/bin/sh
#$Id: avi2flv.sh,v 1.4 2006/11/26 14:44:53 ang23 Exp $
#first arg: filename to convert (avi,vob,mpg,etc.), extension will be replaced with flv
#second arg: startposition in seconds (integer)
#third arg: preview image time position, format (00:00:00) (HH:MM:SS)
#main program
if [ "$#" == "0" ]; then
exit 0
fi
if [ ! -f $1 ]; then
echo "argument 1 should be a movie file"
exit 0
fi
OUT="./"
INPUT=`basename ${1}`
LOG="${INPUT}-`date +%Y%m%d`-encoding.log"
INPUTDIR=`dirname ${1}`
if [ -e $2 ]; then
STARTPOS=0
else
STARTPOS=${2}
fi
if [ -e $3 ]; then
GRABTIME=00:00:01
else
GRABTIME=${3}
fi
echo "Encoding HQ video..."
time mencoder \
${INPUTDIR}/${INPUT} \
-ss ${STARTPOS} \
-af volnorm=1 \
-ofps 20 \
-o ${OUT}${INPUT%.*}-hq.flv \
-of lavf \
-oac mp3lame \
-lameopts abr:br=64 \
-srate 22050 \
-ovc lavc \
-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames \
-lavcopts vcodec=flv:keyint=50:vbitrate=256:mbd=2:mv0:trell:\
v4mv:cbp:last_pred=3 -vop scale=320:240 > $LOG 2>&1
echo "Adding flv metadata to HQ video..."
time flvtool2 -U ${OUT}${INPUT%.*}-hq.flv >> $LOG 2>&1
echo "Creating PNG preview... at ${GRABTIME} position"
time ffmpeg -y -i ${INPUTDIR}/${INPUT} \
-vframes 1 -ss ${GRABTIME} -an -vcodec png \
-f rawvideo -s 160x120 \
${OUT}${INPUT%.*}-hq_1_grab-thumb.png >> $LOG 2>&1
upload your flv to some dir accessible and served by webserver, remember URLtoFLV
use flowplayer wikiplugin in wiki-type tikiwiki object to put video online:
Copy to clipboard
{FLOWPLAYER(videofile=URLtoFLV)}{FLOWPLAYER}
FlowPlayer is published with Apache License version 2.0
the flowplayer wiki-plugin is GNU/LGPL as most of Tikiwiki code