Well for a video sharing site like that, you don't need to develop SWF files on the fly. You need to produce .FLV files, and then have a default video player that loads the FLV.
Flex isn't needed, the only Javascript needed is to embed the files, and the PHP would be the most needed.
http://www.adobe.com/products/flashmediaserver/ here is the official products to do this.
You can also use FFMPEG (
http://ffmpeg.org/) which can convert AVI to FLV.
Its not as much an advanced topic as it is just difficult to get it all to work properly together. I haven't tried FFMPEG but know others say its great. If the s cale of your project is relatively small, it should be fine, otherwise you'd have to go enterprise with media server.