src/main/java/org/jcodec/api/SequenceEncoder.java
public void encodeNativeFrame(Picture pic) throws IOException {
		if (pic.getColor() != ColorSpace.RGB)
			throw new IllegalArgumentException("The input images is expected in RGB color.");

		ColorSpace sinkColor = sink.getInputColor();
		LoanerPicture toEncode;
		if (sinkColor != null) {
			toEncode = pixelStore.getPicture(pic.getWidth(), pic.getHeight(), sinkColor);
			transform.transform(pic, toEncode.getPicture());
		} else {
			toEncode = new LoanerPicture(pic, 0);
		}

		Packet pkt = Packet.createPacket(null, timestamp, fps.getNum(), fps.getDen(), frameNo, FrameType.KEY, null);
		sink.outputVideoFrame(new VideoFrameWithPacket(pkt, toEncode));

		if (sinkColor != null)
			pixelStore.putBack(toEncode);

		timestamp += fps.getDen();
		frameNo++;
	}
public void encodeNativeFrame(Picture pic) throws IOException {
		if (pic.getColor() != ColorSpace.RGB)
			throw new IllegalArgumentException("The input images is expected in RGB color.");

		ColorSpace sinkColor = sink.getInputColor();
		LoanerPicture toEncode;
		if (sinkColor != null) {
			toEncode = pixelStore.getPicture(pic.getWidth(), pic.getHeight(), sinkColor);
			transform.transform(pic, toEncode.getPicture());
		} else {
			toEncode = new LoanerPicture(pic, 0);
		}

		Packet pkt = Packet.createPacket(null, timestamp, fps.getNum(), fps.getDen(), frameNo, FrameType.KEY, null);
		sink.outputVideoFrame(new VideoFrameWithPacket(pkt, toEncode));

		if (sinkColor != null)
			pixelStore.putBack(toEncode);

		timestamp += fps.getDen();
		frameNo++;
	}
public void encodeNativeFrame ( Picture pic ) throws IOException { if ( pic . getColor ( ) != ColorSpace . RGB ) throw new IllegalArgumentException ( "The input images is expected in RGB color." ) ; ColorSpace sinkColor = sink . getInputColor ( ) ; LoanerPicture toEncode ; if ( sinkColor != null ) { toEncode = pixelStore . getPicture ( pic . getWidth ( ) , pic . getHeight ( ) , sinkColor ) ; transform . transform ( pic , toEncode . getPicture ( ) ) ; } else { toEncode = new LoanerPicture ( pic , 0 ) ; } Packet pkt = Packet . createPacket ( null , timestamp , fps . getNum ( ) , fps . getDen ( ) , frameNo , FrameType . KEY , null ) ; sink . outputVideoFrame ( new VideoFrameWithPacket ( pkt , toEncode ) ) ; if ( sinkColor != null ) pixelStore . putBack ( toEncode ) ; timestamp += fps . getDen ( ) ; frameNo ++ ; }
Encodes a frame into a movie.

@param pic
@throws IOException
Encodes a frame into a movie .