File size: 2,146 Bytes
07e92a8
 
 
 
 
 
e44b2d4
 
 
ac016ec
07e92a8
 
 
 
 
 
 
 
 
 
 
 
ac016ec
07e92a8
ac016ec
07e92a8
ac016ec
07e92a8
 
 
ac016ec
07e92a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e44b2d4
 
 
 
 
 
 
 
 
 
 
 
07e92a8
ac016ec
07e92a8
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
source_path = None
target_path = None
output_path = None
frame_processors = []
keep_fps = True
keep_audio = True
video_encoder = 'libx264'
video_quality = 50
log_level = 'error'

def set_global_paths(src: str, tgt: str, out: str) -> None:
    """
    Set global paths for source, target, and output.
    Args:
        src (str): Source path.
        tgt (str): Target path.
        out (str): Output path.
    """
    global source_path, target_path, output_path
    source_path = src
    target_path = tgt
    output_path = out

def set_processing_options(encoder: str, quality: int, log: str) -> None:
    """
    Set options for video processing.
    Args:
        encoder (str): Video encoder.
        quality (int): Video quality.
        log (str): Log level.
    """
    global video_encoder, video_quality, log_level
    video_encoder = encoder
    video_quality = quality
    log_level = log

def set_frame_processors(processors: list) -> None:
    """
    Set the frame processors.
    Args:
        processors (list): List of frame processors.
    """
    global frame_processors
    frame_processors = processors

def set_keep_options(fps: bool, audio: bool) -> None:
    """
    Set options to keep FPS and audio.
    Args:
        fps (bool): Whether to keep FPS.
        audio (bool): Whether to keep audio.
    """
    global keep_fps, keep_audio
    keep_fps = fps
    keep_audio = audio

def clean_temp(target_path: str) -> None:
    """
    Cleans up temporary files after processing.
    Args:
        target_path (str): Path of the target file to be cleaned up.
    """
    if os.path.exists(target_path):
        os.remove(target_path)
        print(f"Cleaned up temporary file: {target_path}")
    else:
        print(f"No temporary file found at: {target_path}")

def some_function():
    global source_path, target_path, output_path, frame_processors, keep_fps, keep_audio
    print(f"Source Path: {source_path}")
    print(f"Target Path: {target_path}")
    print(f"Output Path: {output_path}")
    print(f"Frame Processors: {frame_processors}")
    print(f"Keep FPS: {keep_fps}")
    print(f"Keep Audio: {keep_audio}")