public class VideoExport extends Object
import com.hamoid.*; VideoExport videoExport; void setup() { size(600, 600); videoExport = new VideoExport(this, "basic.mp4"); } void draw() { background(#224488); rect(frameCount * frameCount % width, 0, 40, height); videoExport.saveFrame(); }
Constructor and Description |
---|
VideoExport(processing.core.PApplet parent,
String outputFileName)
Constructor, usually called in the setup() method in your sketch to
initialize and start the library.
|
VideoExport(processing.core.PApplet parent,
String outputFileName,
processing.core.PGraphics pg)
Constructor that allows to set a PGraphics to export as video (advanced)
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Called automatically by Processing to clean up before shut down
|
void |
dontCallLoadPixels()
Tells VideoExport not to call loadPixels().
|
void |
dontSaveDebugInfo()
Call this method if you don't want a debug text file saved together
with the video file.
|
void |
forgetFfmpegPath()
Makes the library forget about where the ffmpeg binary was located.
|
void |
onFfmpegSelected(File selection)
Called internally by the file selector when the user chooses
the location of ffmpeg on the disk.
|
void |
saveFrame()
Adds one frame to the video file.
|
void |
setFrameRate(float frameRate)
Set the frame rate of the produced video file.
|
void |
setGraphics(processing.core.PGraphics pg)
Set the PGraphics element.
|
void |
setQuality(int crf)
Set the quality of the produced video file.
|
static String |
version()
Return the version of the library.
|
public static final String VERSION
public VideoExport(processing.core.PApplet parent, String outputFileName)
parent
- Parent PApplet, normally "this" when called from setup()outputFileName
- The name of the video file to produce, for instance
"beauty.mp4"import com.hamoid.*; VideoExport videoExport; void setup() { size(600, 600); videoExport = new VideoExport(this, "basic.mp4"); } void draw() { background(#224488); rect(frameCount * frameCount % width, 0, 40, height); videoExport.saveFrame(); }
public VideoExport(processing.core.PApplet parent, String outputFileName, processing.core.PGraphics pg)
parent
- Parent PApplet, normally "this" when called from setup()outputFileName
- The name of the video file to produce, for instance
"beauty.mp4"pg
- PGraphics object to export as videoimport com.hamoid.*; VideoExport videoExport; PGraphics pg; void setup() { size(600, 600); pg = createGraphics(640, 480); videoExport = new VideoExport(this, "pgraphics.mp4", pg); } void draw() { background(0); text("exporting video " + frameCount, 50, 50); pg.beginDraw(); pg.background(#224488); pg.rect(pg.width * noise(frameCount * 0.01), 0, 40, pg.height); pg.endDraw(); videoExport.saveFrame(); }
public void setGraphics(processing.core.PGraphics pg)
pg
- A PGraphics object. Probably only called when working with an
array of PGraphics objects.public void setQuality(int crf)
crf
- A value between 0 (high compression) and 100 (high quality,
lossless). Default is 70.public void setFrameRate(float frameRate)
frameRate
- The frame rate at which the resulting video file should be
played. The default is 30, which is the recommended for online
video.public void dontCallLoadPixels()
public void dontSaveDebugInfo()
public void saveFrame()
public void forgetFfmpegPath()
public void dispose()
public static String version()
public void onFfmpegSelected(File selection)
selection
- Processing Library VideoExport by Abe Pazos. (c) 2016