Struct adder_codec_rs::transcoder::source::video::Video
source · pub struct Video<W: Write> {
pub state: VideoState,
pub display_frame: Frame,
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: Frame
The current instantaneous display frame
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>
§encoder_type: EncoderType
Implementations§
source§impl<W: Write + 'static> Video<W>
impl<W: Write + 'static> 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>,
encoder_type: EncoderType,
encoder_options: EncoderOptions,
write: W
) -> Result<Self, SourceError>
pub fn write_out( self, source_camera: Option<SourceCamera>, time_mode: Option<TimeMode>, 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 show_display(self, show_display: bool) -> Self
pub fn show_display(self, show_display: bool) -> Self
Set the display mode for the instantaneous view.
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
)
pub fn update_detect_features( &mut self, detect_features: bool, show_features: ShowFeatureMode )
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
pub fn get_encoder_options(&self) -> EncoderOptions
pub fn get_time_mode(&self) -> TimeMode
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