pub struct Video<W: Write + Send + Sync + 'static> {
pub state: VideoState,
pub display_frame_features: Frame,
pub instantaneous_view_mode: FramedViewMode,
pub event_sender: Sender<Vec<Event>>,
pub encoder: Encoder<W>,
pub encoder_type: EncoderType,
/* private fields */
}
Expand description
Attributes common to ADΔER transcode process
Fields§
§state: VideoState
The current state of the video transcode
display_frame_features: Frame
The current instantaneous display frame with the features drawn on it
instantaneous_view_mode: FramedViewMode
The current view mode of the instantaneous frame
event_sender: Sender<Vec<Event>>
Channel for sending events to the encoder
encoder: Encoder<W>
The object that takes in ADDER events, potentially transforms them in some way, and writes them somewhere
encoder_type: EncoderType
The type of encoder being used (e.g., compressed or raw)
Implementations§
Source§impl<W: Write + 'static + Send + Sync> Video<W>
impl<W: Write + 'static + Send + Sync> Video<W>
Sourcepub fn c_thresh_pos(self, c_thresh_pos: u8) -> Self
👎Deprecated since 0.3.4: please use update_crf
or update_quality_manual
instead
pub fn c_thresh_pos(self, c_thresh_pos: u8) -> Self
update_crf
or update_quality_manual
insteadSet the positive contrast threshold
Sourcepub fn c_thresh_neg(self, _c_thresh_neg: u8) -> Self
👎Deprecated since 0.3.4: please use update_crf
or update_quality_manual
instead
pub fn c_thresh_neg(self, _c_thresh_neg: u8) -> Self
update_crf
or update_quality_manual
insteadSet the negative contrast threshold
Sourcepub fn chunk_rows(self, chunk_rows: usize) -> Self
pub fn chunk_rows(self, chunk_rows: usize) -> Self
Set the number of rows to process at a time (in each thread)
Sourcepub fn time_parameters(
self,
tps: DeltaT,
ref_time: DeltaT,
delta_t_max: DeltaT,
time_mode: Option<TimeMode>,
) -> Result<Self, SourceError>
pub fn time_parameters( self, tps: DeltaT, ref_time: DeltaT, delta_t_max: DeltaT, time_mode: Option<TimeMode>, ) -> Result<Self, SourceError>
Set the time parameters for the video.
These parameters, in conjunction, determine the temporal resolution and maximum transcode accuracy/quality.
§Arguments
tps
: ticks per secondref_time
: reference time in ticks.delta_t_max
: maximum time difference between events of the same pixel, in ticks
returns: Result<Video<W>, Box<dyn Error, Global>>
Sourcepub fn write_out(
self,
source_camera: Option<SourceCamera>,
time_mode: Option<TimeMode>,
pixel_multi_mode: Option<PixelMultiMode>,
adu_interval: Option<usize>,
encoder_type: EncoderType,
encoder_options: EncoderOptions,
write: W,
) -> Result<Self, SourceError>
pub fn write_out( self, source_camera: Option<SourceCamera>, time_mode: Option<TimeMode>, pixel_multi_mode: Option<PixelMultiMode>, adu_interval: Option<usize>, encoder_type: EncoderType, encoder_options: EncoderOptions, write: W, ) -> Result<Self, SourceError>
Write out the video to a file.
§Arguments
source_camera
: the type of video sourcetime_mode
: the time mode of the videowrite
: the output stream to write to
Sourcepub fn end_write_stream(&mut self) -> Result<Option<W>, SourceError>
pub fn end_write_stream(&mut self) -> Result<Option<W>, SourceError>
Close and flush the stream writer.
§Errors
Returns an error if the stream writer cannot be closed cleanly.
Sourcepub fn get_ref_time(&self) -> u32
pub fn get_ref_time(&self) -> u32
Get ref_time
Sourcepub fn get_delta_t_max(&self) -> u32
pub fn get_delta_t_max(&self) -> u32
Get delta_t_max
Sourcepub fn update_delta_t_max(&mut self, dtm: u32)
pub fn update_delta_t_max(&mut self, dtm: u32)
Set a new value for delta_t_max
Sourcepub fn update_detect_features(
&mut self,
detect_features: bool,
show_features: ShowFeatureMode,
feature_rate_adjustment: bool,
feature_cluster: bool,
)
pub fn update_detect_features( &mut self, detect_features: bool, show_features: ShowFeatureMode, feature_rate_adjustment: bool, feature_cluster: bool, )
Set a new bool for feature_detection
Sourcepub fn update_adder_thresh_pos(&mut self, c: u8)
👎Deprecated since 0.3.4: please use update_crf
or update_quality_manual
instead
pub fn update_adder_thresh_pos(&mut self, c: u8)
update_crf
or update_quality_manual
insteadSet a new value for c_thresh_pos
Sourcepub fn update_adder_thresh_neg(&mut self, _c: u8)
👎Deprecated since 0.3.4: please use update_crf
or update_quality_manual
instead
pub fn update_adder_thresh_neg(&mut self, _c: u8)
update_crf
or update_quality_manual
insteadSet a new value for c_thresh_neg
Sourcepub fn detect_features(
self,
detect_features: bool,
show_features: ShowFeatureMode,
) -> Self
pub fn detect_features( self, detect_features: bool, show_features: ShowFeatureMode, ) -> Self
Set whether or not to detect features, and whether or not to display the features
Sourcepub fn get_encoder_options(&self) -> EncoderOptions
pub fn get_encoder_options(&self) -> EncoderOptions
Get the encoder options
Sourcepub fn get_time_mode(&self) -> TimeMode
pub fn get_time_mode(&self) -> TimeMode
Get the time mode of the video
Sourcepub fn update_quality_manual(
&mut self,
c_thresh_baseline: u8,
c_thresh_max: u8,
delta_t_max_multiplier: u32,
c_increase_velocity: u8,
feature_c_radius: f32,
)
pub fn update_quality_manual( &mut self, c_thresh_baseline: u8, c_thresh_max: u8, delta_t_max_multiplier: u32, c_increase_velocity: u8, feature_c_radius: f32, )
Manually set the parameters dictating quality
pub fn update_encoder_options(&mut self, options: EncoderOptions)
pub fn update_roi(&mut self, roi: Option<Roi>)
Sourcepub fn get_event_size(&self) -> u8
pub fn get_event_size(&self) -> u8
Get the size of the raw events (in bytes)
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for Video<W>where
W: Freeze,
impl<W> RefUnwindSafe for Video<W>where
W: RefUnwindSafe,
impl<W> Sync for Video<W>
impl<W> Unpin for Video<W>where
W: Unpin,
impl<W> UnwindSafe for Video<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more