public class FFMpegWrapper
extends java.lang.Object
Constructor and Description |
---|
FFMpegWrapper(java.io.File file)
Creates a wrapper to run ffmpeg for the given video file.
|
FFMpegWrapper(java.io.File file,
java.io.File workingDir)
Creates a wrapper to run ffmpeg for the given video file.
|
Modifier and Type | Method and Description |
---|---|
static FFMpegWrapper |
fromProfile(java.io.File inputFile,
VideoProfile profile,
java.io.File workingDir)
Turns a video profile into a FFMpegWrapper.
|
java.io.File |
getClip(double startTime,
double endTime,
java.lang.String mimeType)
Create clip from the video.
|
java.lang.StringBuilder |
getFFMpegOutput() |
java.awt.image.BufferedImage |
getFilmStrip(int frames,
int width) |
long |
getInputDuration() |
java.awt.Dimension |
getInputSize() |
java.lang.String |
getOutputExtension() |
java.lang.String |
getOutputMimetype() |
java.awt.Dimension |
getOutputSize() |
java.lang.String |
getProfileName() |
java.lang.String |
getRenditionSelector() |
java.awt.image.BufferedImage[] |
getThumbnails(int thumbnails,
int start)
Create thumbnails from the video.
|
java.io.File |
join(java.io.File other,
java.lang.String name) |
void |
setAudioBitrate(int audioBitrate) |
void |
setAudioChannels(int i) |
void |
setAudioCodec(java.lang.String audioCodec) |
void |
setAudioSamplingRate(int audioSamplingRate) |
void |
setBitrate(int bitrate)
Sets the output video bitrate in kbits/second
|
void |
setBitrateTolerance(int i) |
void |
setClipDuration(long i) |
void |
setCropArea(java.awt.Rectangle rectangle) |
void |
setCustomFlags(java.lang.String[] flags) |
void |
setDuration(long duration) |
void |
setExecutableLocator(ExecutableLocator locator) |
void |
setFitInside() |
void |
setFitInside(boolean fitInside) |
void |
setFps(java.lang.String fps) |
void |
setInput(java.io.File f) |
void |
setInputsize(java.awt.Dimension inputsize) |
void |
setLetterbox() |
void |
setLetterbox(boolean letterbox) |
void |
setOutputExtension(java.lang.String extension) |
void |
setOutputMimetype(java.lang.String outputMimetype) |
void |
setOutputSize(java.awt.Dimension dimension) |
void |
setPreset(java.lang.String preset) |
void |
setProfileName(java.lang.String profileName) |
void |
setRenditionSelector(java.lang.String renditionSelector) |
void |
setStartTime(long i) |
void |
setTwoPass() |
void |
setTwoPass(boolean twoPass) |
void |
setVideoCodec(java.lang.String videoCodec) |
java.io.File |
transcode() |
java.io.File |
transcode(java.lang.String extension) |
java.io.File |
trim(java.lang.String name) |
public FFMpegWrapper(java.io.File file)
file
- video file to call ffmpeg withpublic FFMpegWrapper(java.io.File file, java.io.File workingDir)
FFMpegWrapper
as
ffmpeg's temp file name in 2-pass encoding is hard coded in the ffmpeg
build, which causes problem while running simultaneous multiple
encodings. Even you use -passlogfile option, x264_2pass.log file name is
hard coded in the older ffmpeg builds. For more details please refer to
bug:42346.file
- video file to call ffmpeg withworkingDir
- a working directory for ffmpeg; if null
,
the current working directory of the JVM is usedpublic java.lang.String getOutputExtension()
public void setOutputExtension(java.lang.String extension)
public java.lang.StringBuilder getFFMpegOutput()
public java.lang.String getProfileName()
public void setProfileName(java.lang.String profileName)
public java.lang.String getRenditionSelector()
public void setRenditionSelector(java.lang.String renditionSelector)
public java.lang.String getOutputMimetype()
public void setOutputMimetype(java.lang.String outputMimetype)
public void setTwoPass()
public void setTwoPass(boolean twoPass)
public void setPreset(java.lang.String preset)
public void setAudioSamplingRate(int audioSamplingRate)
public void setAudioBitrate(int audioBitrate)
public void setVideoCodec(java.lang.String videoCodec)
public void setAudioCodec(java.lang.String audioCodec)
public void setBitrate(int bitrate)
bitrate
- The bitratepublic void setInput(java.io.File f)
public void setExecutableLocator(ExecutableLocator locator)
public void setOutputSize(java.awt.Dimension dimension)
public java.awt.Dimension getOutputSize()
public long getInputDuration()
public java.awt.Dimension getInputSize()
public java.awt.image.BufferedImage[] getThumbnails(int thumbnails, int start)
thumbnails
- The number of desired thumbnails.start
- The start position in seconds from where to take the first
thumbnail.public java.io.File getClip(double startTime, double endTime, java.lang.String mimeType)
startTime
- startTime of the clip.endTime
- The end position in seconds of the clip .public java.io.File join(java.io.File other, java.lang.String name) throws java.io.IOException
java.io.IOException
public java.io.File trim(java.lang.String name) throws java.io.IOException
java.io.IOException
public java.io.File transcode() throws java.io.IOException
java.io.IOException
public java.io.File transcode(java.lang.String extension) throws java.io.IOException
java.io.IOException
public void setLetterbox()
public void setLetterbox(boolean letterbox)
public void setFitInside()
public void setFitInside(boolean fitInside)
public java.awt.image.BufferedImage getFilmStrip(int frames, int width)
public void setFps(java.lang.String fps)
public void setBitrateTolerance(int i)
public void setAudioChannels(int i)
public void setCustomFlags(java.lang.String[] flags)
public void setStartTime(long i)
public void setClipDuration(long i)
public void setCropArea(java.awt.Rectangle rectangle)
public void setInputsize(java.awt.Dimension inputsize)
public void setDuration(long duration)
public static FFMpegWrapper fromProfile(java.io.File inputFile, VideoProfile profile, java.io.File workingDir)
inputFile
- profile
- can be the cq:Page or jcr:content node of a profile pageworkingDir
- working directory for ffmpeg"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"