Basic conversion with ffmpeg and qt-faststart
Code:
$METADATA = '-metadata title="$TITLE" -metadata author="$AUTHOR" -metadata description="$DESCRIPTION"';
//FILE TO MP4
avconv -i /original/path/$file -vf "movie=/static/files/watermark.png [watermark]; [in][watermark] overlay=$WM_X:$WM_Y [out]" -s $Wx$H -y -c:v libx264 -crf 24 -maxrate $RATEk -bufsize $BUFFERk -pix_fmt yuv420p -r 24 -c:a aac -b:a $AUDIO_RATEk -strict -2 -ac 1 $METADATA -tune zerolatency /out/path/$FILE_NAME.mp4 2>&1';
//MOV atom to start
qt-faststart /out/path/$FILE_NAME.mp4 /final/path/$FILE_NAME.mp4
But for $100 you will find some indians that will mess up with your servers.