Class Frame
java.lang.Object
com.github.kokorin.jaffree.ffmpeg.Frame
Represents video/audio data to be encoded or has been decoded.
Note: image and samples must not be changed after creating Frame instance.
Otherwise it may affect (or event corrupt) produced media, because Jaffree internally
maintains frame reordering buffer while producing video.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFrame(int streamId, long pts, BufferedImage image, int[] samples) CreatesFrame. -
Method Summary
Modifier and TypeMethodDescriptionstatic FramecreateAudioFrame(int streamId, long pts, int[] samples) Creates audioFrame, image is set to null.static FramecreateVideoFrame(int streamId, long pts, BufferedImage image) Creates videoFrame, samples are set to null.getImage()Returns video frame image (or null if current frame isn't video frame).longgetPts()PTS in correspondingStreamtimebase.int[]Returns audio samples (or null if current frame isn't audio frame).inttoString()
-
Constructor Details
-
Method Details
-
getStreamId
public int getStreamId()- Returns:
- stream id (starting with 0)
-
getPts
public long getPts()PTS in correspondingStreamtimebase. E.g. Track's timebase is 44100 (audio track), timecode is 4410 - it means 0.1 second (100 milliseconds)- Returns:
- timecode
- See Also:
-
getImage
Returns video frame image (or null if current frame isn't video frame).- Returns:
- video frame image
-
getSamples
public int[] getSamples()Returns audio samples (or null if current frame isn't audio frame).- Returns:
- audio samples in PCM S32BE format
-
toString
-
createVideoFrame
Creates videoFrame, samples are set to null. -
createAudioFrame
Creates audioFrame, image is set to null.
-