I want to develop a video streaming application. But i am not very sure about how to start.

I have some queries

1. To compress files should i write my own codec or there are any codec already available which i can use on server to compress the files?

2. If i compress the files then shud i decompress on the device ?

3. what is the plug-in i can use on the device which supports rtsp? Or Is there any default plug-in available on the device?

4. Is there any example code for video streaming ?

thanks in advance