Java的Flv類庫 JFLVLib
JFlvLib 是一個用來生成 Flv Flash視頻的Java類庫。
示例: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>
本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!