Java的Flv类库 JFLVLib

fmms 13年前
     JFlvLib 是一个用来生成 Flv Flash视频的Java类库。    <pre class="brush:java; toolbar: true; auto-links: false;">示例:   package edu.mit.star.flvexample;    import java.awt.Dimension;  import java.awt.image.BufferedImage;  import java.io.IOException;  import java.io.OutputStream;    import edu.mit.star.flv.Capture;  import edu.mit.star.flv.CaptureFactory;      public class Main  {        public static void main(String[] args)      {   try   {    OutputStream os = new java.io.FileOutputStream( "z:\\temp\\test.flv" );    int xx = 256 ;    int yy = 512 ;    Capture c = CaptureFactory.getCapturer( os , new Dimension(xx , yy) ) ;    int time = 0 ;    while( time < 5000 )    {     BufferedImage image = c.newFrame() ;          image.getGraphics().drawOval(0, 0, xx*time/5000, yy*time/5000);     image.flush();           c.writeFrame(image, time);     time += 250;     System.out.println( "Generating " + time + " ms frame.");    }    os.close();   }   catch( IOException ex )   {    ex.printStackTrace();   }      }  }</pre>    <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1325770292953" target="_blank">http://www.open-open.com/lib/view/home/1325770292953</a></p>