Class FrameInput
- All Implemented Interfaces:
Input
setFrameRate(Number) for video producing.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classTcpNegotiatorimplementation which usesFrameInput.FrameWriterto send bytes over TCP connection.protected static interface -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFrameInput(FrameInput.FrameWriter frameWriter, String format) CreatesFrameInputforFFmpeg. -
Method Summary
Modifier and TypeMethodDescriptionfinal FrameInputFormat change is prohibited afterFrameInputinstantiation.setFrameRate(Number frameRate) Set frame rate.setFrameRate(String streamSpecifier, Number frameRate) Set frame rate.static FrameInputwithProducer(FrameProducer producer) CreatesFrameInputwith specified frame producer.static FrameInputwithProducer(FrameProducer producer, ImageFormat imageFormat) CreatesFrameInputwith specified frame producer and image format.static FrameInputwithProducer(FrameProducer producer, ImageFormat imageFormat, long frameOrderingBufferMillis) CreatesFrameInputwith specified frame producer, format and frame ordering bufferstatic FrameInputwithProducerAlpha(FrameProducer producer) CreatesFrameInputwith specified frame producer with alpha channel.Methods inherited from class com.github.kokorin.jaffree.ffmpeg.TcpInput
helperThreadMethods inherited from class com.github.kokorin.jaffree.ffmpeg.BaseInput
buildArguments, setReadAtFrameRate, setStreamLoopMethods inherited from class com.github.kokorin.jaffree.ffmpeg.BaseInOut
addArgument, addArguments, getAdditionalArguments, setCodec, setCodec, setDuration, setDuration, setFrameSize, setFrameSize, setFrameSize, setPixelFormat, setPixelFormat, setPosition, setPosition, setPositionEof, setPositionEof, thisAsT, toArgumentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.github.kokorin.jaffree.ffmpeg.Input
buildArguments, helperThread
-
Constructor Details
-
FrameInput
CreatesFrameInputforFFmpeg.- Parameters:
frameWriter- frame writerformat- media format- See Also:
-
-
Method Details
-
setFrameRate
Set frame rate.As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps.
As an output option, duplicate or drop input frames to achieve constant output frame rate fps.
It's strongly recommended to specify videoFrameRate for video producing.
Otherwise conversion can be very slow (20-50 times slower) and even can result in corrupted video.
- Overrides:
setFrameRatein classBaseInOut<FrameInput>- Parameters:
frameRate- Hz value, fraction or abbreviation- Returns:
- this
-
setFrameRate
Set frame rate.As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps.
As an output option, duplicate or drop input frames to achieve constant output frame rate fps.
It's strongly recommended to specify videoFrameRate for video producing.
Otherwise conversion can be very slow (20-50 times slower) and even can result in corrupted video.
- Overrides:
setFrameRatein classBaseInOut<FrameInput>- Parameters:
streamSpecifier- stream specifierframeRate- Hz value, fraction or abbreviation- Returns:
- this
- See Also:
-
setFormat
Format change is prohibited afterFrameInputinstantiation.- Overrides:
setFormatin classBaseInOut<FrameInput>- Parameters:
format- format- Returns:
- never returns
- Throws:
JaffreeException- always
-
withProducer
CreatesFrameInputwith specified frame producer.Note: frame producer should produce video frames in BGR24 format.
- Parameters:
producer- frame producer- Returns:
- FrameInput
- See Also:
-
withProducerAlpha
CreatesFrameInputwith specified frame producer with alpha channel.Note: frame producer should produce video frames in ABGR format.
- Parameters:
producer- frame producer- Returns:
- FrameInput
- See Also:
-
withProducer
CreatesFrameInputwith specified frame producer and image format.- Parameters:
producer- frame producerimageFormat- video frame image format- Returns:
- FrameInput
- See Also:
-
withProducer
public static FrameInput withProducer(FrameProducer producer, ImageFormat imageFormat, long frameOrderingBufferMillis) CreatesFrameInputwith specified frame producer, format and frame ordering bufferFrame ordering buffer allows
FrameProducerto produce frame without strict ordering (which is required by NUT format).Note: too long frame ordering buffer may cause
OutOfMemoryErroror performance degradation.- Parameters:
producer- frame producerimageFormat- video frame image formatframeOrderingBufferMillis- frame ordering buffer milliseconds- Returns:
- FrameInput
- See Also:
-