I suppose you want to play it on client side. In that case does not matter what programming language you use on server side.
First of all, AVI is not the best choice, because it is only a container that can hold streams encoded with many different codecs. And might not be supported on all platforms. So you have to take the client side into consideration. So forget avi.
If you want a wider audience, you can use HTML5 native video support, with fallback to flash. For that you can use this little one:
http://www.videojs.com/[
^]
If you stick to AVI, you will be bound to several platforms, and you need to have a good
common plugin (not codec) installed on each and every client, like VLC provices:
https://wiki.videolan.org/Documentation:WebPlugin/[
^], but I discourage you in taking this path.