Utils Module

This module contains utility functions.

Progress

Progress tracking functionality for FMUS-VID.

This module provides utilities for tracking and reporting operation progress.

class fmusvid.utils.progress.OperationType(value)[source]

Types of video operations for progress tracking.

LOAD = 'Loading'
SAVE = 'Saving'
ENCODE = 'Encoding'
DECODE = 'Decoding'
PROCESS = 'Processing'
ANALYZE = 'Analyzing'
EXPORT = 'Exporting'
STREAM = 'Streaming'
class fmusvid.utils.progress.ProgressStats(start_time, current_time, total_frames, processed_frames, fps, eta, percentage)[source]

Statistics for operation progress.

start_time: float
current_time: float
total_frames: int
processed_frames: int
fps: float
eta: timedelta
percentage: float
__init__(start_time, current_time, total_frames, processed_frames, fps, eta, percentage)
class fmusvid.utils.progress.ProgressTracker(operation, total_frames, callback=None, update_interval=0.1)[source]

Class for tracking operation progress.

__init__(operation, total_frames, callback=None, update_interval=0.1)[source]

Initialize progress tracker.

Parameters:
  • operation (OperationType) – Type of operation being tracked

  • total_frames (int) – Total number of frames to process

  • callback (Optional[Callable[[ProgressStats], None]]) – Function to call with progress updates

  • update_interval (float) – Minimum time between progress updates

update(frames=1)[source]

Update progress.

Parameters:

frames (int) – Number of frames processed since last update

Return type:

None

complete()[source]

Mark operation as complete.

Return type:

None

class fmusvid.utils.progress.ConsoleProgress(operation, total_frames)[source]

Console-based progress reporter.

__init__(operation, total_frames)[source]

Initialize console progress reporter.

Parameters:
  • operation (OperationType) – Type of operation being tracked

  • total_frames (int) – Total number of frames to process

update(frames=1)[source]

Update progress.

Parameters:

frames (int) – Number of frames processed

Return type:

None

complete()[source]

Mark operation as complete.

Return type:

None

class fmusvid.utils.progress.ProgressManager[source]

Manager for tracking multiple operations.

__init__()[source]

Initialize progress manager.

start_operation(name, operation, total_frames, callback=None)[source]

Start tracking a new operation.

Parameters:
Return type:

ProgressTracker

Returns:

Progress tracker for the operation

update(name, frames=1)[source]

Update operation progress.

Parameters:
  • name (str) – Operation identifier

  • frames (int) – Frames processed

Return type:

None

complete(name)[source]

Mark operation as complete.

Parameters:

name (str) – Operation identifier

Return type:

None

get_stats(name)[source]

Get current statistics for an operation.

Parameters:

name (str) – Operation identifier

Return type:

Optional[ProgressStats]

Returns:

Current progress statistics or None if operation not found

Benchmark

Optimization

Quality