How to convert swf to flv at run time

Hi My query is can we convert swf to flv at run time. I donot want to use any third party converter. it is simillar to jpeg encoder in AS 3.0. You can save the image in AS3. Simillary i want to save my flv. Please let me know if you guys have any idea about that. Thanks in Advance.