Set/Get Video Properties
Source:R/StreamClass.R
, R/VideoClass.R
, R/VideoWriterClass.R
, and 1 more
setProp.Rd
Usage
# S3 method for Rcpp_Stream
setProp(x, property, value)
# S3 method for Rcpp_Stream
getProp(x, property)
# S3 method for Rcpp_Video
setProp(x, property, value)
# S3 method for Rcpp_Video
getProp(x, property)
# S3 method for Rcpp_VideoWriter
setProp(x, property, value)
# S3 method for Rcpp_VideoWriter
getProp(x, property)
setProp(x, property, value)
getProp(x, property)
Value
setProp
returns TRUE is the property was set successfully.
getProp
returns a numeric value or a character string depending on
property
.
Note
Video properties are:
POS_MSEC
: Current position of the video file in milliseconds.POS_FRAMES
: 0-based index of the frame to be decoded/captured next.POS_AVI_RATIO
Relative position of the video file: 0=start of the film, 1=end of the film.FRAME_WIDTH
: Width in pixels of the frames in the video stream.FRAME_HEIGHT
: Height in pixels of the frames in the video stream.FPS
: Frame rate in frames per second.FOURCC
: 4-character FOURCC code of the codecFRAME_COUNT
: Number of frames in the video file.
Setting stream properties depends on a lot of things, mainly your operating system, the camera drivers installed on your computer and the camera itself. As a consequence, setting stream values might not work at all with your installation.
Stream properties are:
FRAME_WIDTH
: Width in pixels of the frames in the video stream.FRAME_HEIGHT
: Height in pixels of the frames in the video stream.BRIGHTNESS
: Brightness of the imageCONTRAST
: Contrast of the imageSATURATION
: Saturation of the imageHUE
: Hue of the imageGAIN
: Gain of the imageEXPOSURE
: Exposure
Author
Simon Garnier, garnier@njit.edu
Examples
balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision"))
#> Error: Could not open the video.
getProp(balloon, "FPS")
#> Error in eval(expr, envir, enclos): object 'balloon' not found
setProp(balloon, "POS_FRAMES", 25)
#> Error in eval(expr, envir, enclos): object 'balloon' not found