Class CaptureInput<T extends CaptureInput<T>>
- Type Parameters:
T- self
- All Implemented Interfaces:
Input
- Direct Known Subclasses:
CaptureInput.LinuxX11Grab,CaptureInput.MacOsAvFoundation,CaptureInput.WindowsDirectShow,CaptureInput.WindowsGdiGrab
Most of the information comes from ffmpeg capture desktop documentation
TODO list: - Screen selection when multiscreen? - Audio Capture? - Call ffmpeg to return list of devices? list of screens?
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CaptureInput<?> CreatesCaptureInputwith automatically selected capture device.abstract CaptureInput<T> setCaptureCursor(boolean captureCursor) Instructs ffmpeg to capture mouse cursor.setCaptureFrameRate(Number value) Set capture frame rate.abstract CaptureInput<T> setCaptureVideoOffset(int xOffset, int yOffset) Sets the video region offsets.setCaptureVideoSize(int width, int height) Set the video size in the captured video.setCaptureVideoSize(String size) Sets the video size in the captured video given as aStringsuch as 640x480 or hd720.setFrameRate(String streamSpecifier, Number value) Be careful not to specify framerate with the "-r" parameter, like this "ffmpeg -f dshow -r 7.5 -i video=XXX".Methods inherited from class com.github.kokorin.jaffree.ffmpeg.BaseInput
buildArguments, setReadAtFrameRate, setStreamLoopMethods inherited from class com.github.kokorin.jaffree.ffmpeg.BaseInOut
addArgument, addArguments, getAdditionalArguments, helperThread, setCodec, setCodec, setDuration, setDuration, setFormat, setFrameRate, 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
-
CaptureInput
- Parameters:
input- input identifier
-
-
Method Details
-
setCaptureFrameRate
Set capture frame rate.Captures the desktop at the given frame rate
Be careful not to specify framerate with the "-r" parameter, like this "ffmpeg -f dshow -r 7.5 -i video=XXX". This actually specifies that the devices incoming PTS timestamps be ignored and replaced as if the device were running at 7.5 fps [so it runs at default fps, but its timestamps are treated as if 7.5 fps]. This can cause the recording to appear to have "video slower than audio" or, under high cpu load (if video frames are dropped) it will cause the video to fall "behind" the audio [after playback of the recording is done, audio continues on--and gets highly out of sync, video appears to go into "fast forward" mode during high cpu scenes].
- Parameters:
value- Hz value, fraction or abbreviation- Returns:
- this
-
setFrameRate
Be careful not to specify framerate with the "-r" parameter, like this "ffmpeg -f dshow -r 7.5 -i video=XXX". This actually specifies that the devices incoming PTS timestamps be ignored and replaced as if the device were running at 7.5 fps [so it runs at default fps, but its timestamps are treated as if 7.5 fps]. This can cause the recording to appear to have "video slower than audio" or, under high cpu load (if video frames are dropped) it will cause the video to fall "behind" the audio [after playback of the recording is done, audio continues on--and gets highly out of sync, video appears to go into "fast forward" mode during high cpu scenes].- Overrides:
setFrameRatein classBaseInOut<T extends CaptureInput<T>>- Parameters:
streamSpecifier- stream specifiervalue- Hz value, fraction or abbreviation- Returns:
- this
- See Also:
-
setCaptureVideoSize
Set the video size in the captured video.- Parameters:
width- widthheight- height- Returns:
- this
-
setCaptureVideoSize
Sets the video size in the captured video given as aStringsuch as 640x480 or hd720.- Parameters:
size- video size- Returns:
- this
-
setCaptureVideoOffset
Sets the video region offsets.Note: this option doesn't work for some capture devices.
- Parameters:
xOffset- x offsetyOffset- y offset- Returns:
- this
-
setCaptureCursor
Instructs ffmpeg to capture mouse cursor.Note: this feature is not supported on all devices.
- Parameters:
captureCursor- true to capture cursor- Returns:
- this
-
captureDesktop
CreatesCaptureInputwith automatically selected capture device.Note: consider using concrete subclass factory methods.
- Returns:
- CaptureInput
- See Also:
-