MCPcopy Create free account

hub / github.com/RafaelGodoyEbert/ViralCutter / functions

Functions122 in github.com/RafaelGodoyEbert/ViralCutter

↓ 12 callersFunctionconvert_color_to_ass
(hex_color, alpha="00")
webui/app.py:58
↓ 6 callersFunctionfinalize_video
Mux audio and video.
scripts/edit_video.py:162
↓ 6 callersFunctionsubstituir_texto
Função para substituir texto.
scripts/translate_json.py:24
↓ 5 callersFunctioncrop_center_zoom
Crops the center of the frame to fill 9:16 aspect ratio (Zoom effect).
scripts/one_face.py:111
↓ 5 callersFunctionget_uid
()
scripts/export_xml_lib/xml_generator.py:10
↓ 5 callersFunctionresize_with_padding
(frame)
scripts/one_face.py:37
↓ 4 callersFunctionget_mode_avg
(vals)
scripts/export_xml_lib/xml_generator.py:191
↓ 4 callersFunctionhex_to_ass
(h)
webui/subtitle_handler.py:413
↓ 4 callersFunctionsanitize_color
(c)
webui/subtitle_handler.py:286
↓ 4 callersFunctiontimestamp_to_srt
(seconds)
scripts/export_xml_lib/utils.py:4
↓ 3 callersFunctionget_center_bbox
(bbox)
scripts/edit_video.py:57
↓ 3 callersFunctionget_file_block
(fid, fpath, is_audio_only=False)
scripts/generate_premiere_xml.py:107
↓ 3 callersFunctionget_video_dims
Returns (width, height, duration_frames)
scripts/export_xml_lib/utils.py:52
↓ 2 callersFunctionattach_extra_routes
(fastapi_app)
webui/app.py:885
↓ 2 callersFunctioncrop_and_maintain_ar
Recorta uma região baseada no rosto mantendo o aspect ratio do target. Previne deformação (esticar/espremer).
scripts/two_face.py:5
↓ 2 callersFunctioncrop_and_resize_single_face
(frame, face)
scripts/one_face.py:7
↓ 2 callersFunctioncrop_and_resize_two_faces
Recorta e redimensiona dois rostos detectados no frame, ajustando para uma composição vertical 1080x1920 onde cada rosto ocupa metade da tela
scripts/two_face.py:81
↓ 2 callersFunctiondetect_faces_insightface
Detect faces using InsightFace. Returns a list of dicts with 'bbox' and 'kps'. bbox is [x1, y1, x2, y2], kps is 5 keypoints (eyes, nose,
scripts/face_detection_insightface.py:59
↓ 2 callersFunctionfix_time
(t)
scripts/download_video.py:239
↓ 2 callersFunctionformat_time_ass
(time_seconds)
scripts/adjust_subtitles.py:5
↓ 2 callersFunctionformat_timestamp
(seconds)
webui/subtitle_editor.py:13
↓ 2 callersFunctiongenerate_short_fallback
Fallback function: Center Crop (Zoom) or Padding if detection fails.
scripts/edit_video.py:97
↓ 2 callersFunctionget_best_encoder
()
scripts/edit_video.py:19
↓ 2 callersFunctionget_file_block
(fid, fpath, is_audio_only=False)
scripts/export_xml_lib/xml_generator.py:17
↓ 2 callersFunctionget_local_models
()
webui/app.py:158
↓ 2 callersFunctionget_subtitle_config
Returns the subtitle configuration dictionary. Can be expanded to load from a JSON/YAML file in the future.
main_improved.py:45
↓ 2 callersFunctioninit_insightface
Explicit initialization if needed outside import.
scripts/face_detection_insightface.py:33
↓ 2 callersFunctionmake_video_track
(cuts_list, track_type="main")
scripts/export_xml_lib/xml_generator.py:236
↓ 2 callersFunctionparse_timestamp
(ts_str)
webui/subtitle_editor.py:21
↓ 2 callersFunctionrun_ffmpeg
(encoder, preset, additional_args=[])
scripts/burn_subtitles.py:16
↓ 2 callersFunctionsort_by_proximity
Sorts new_faces to match the order of old_faces based on distance. new_faces: list of face objects (bbox or tuple) old_faces: list of
scripts/edit_video.py:65
↓ 2 callersFunctionsrt_time_to_seconds
(t_str)
scripts/create_viral_segments.py:316
↓ 2 callersFunctiontime_to_seconds
(t_str)
scripts/transcribe_video.py:66
↓ 2 callersFunctiontranslate_json_file
(json_file_path: Path, translated_json_path: Path, target_lang)
scripts/translate_json.py:158
↓ 2 callersFunctionvtt_time_to_seconds
(t_str)
scripts/transcribe_video.py:112
↓ 1 callersFunctionadjust_segments
(segments)
scripts/translate_json.py:120
↓ 1 callersFunctionapply_safe_globals_hack
Workaround for 'Weights only load failed' error in newer PyTorch versions. We first try to add safe globals. If that's not enough/fails, we
scripts/transcribe_video.py:13
↓ 1 callersFunctionburn_video_file
Burns subtitles into a single video file.
scripts/burn_subtitles.py:7
↓ 1 callersFunctioncalculate_mouth_ratio
Calculate Mouth Aspect Ratio (MAR) using 68-point landmarks (inner lips). Indices: Inner Lips: 60-67 (0-indexed 60 to 67) Left C
scripts/edit_video.py:194
↓ 1 callersFunctioncall_g4f
(prompt, model_name="gpt-4o-mini")
scripts/create_viral_segments.py:233
↓ 1 callersFunctioncall_gemini
(prompt, api_key, model_name='gemini-2.5-flash-lite-preview-09-2025')
scripts/create_viral_segments.py:199
↓ 1 callersFunctioncheck_nvenc_support
()
scripts/cut_segments.py:8
↓ 1 callersFunctionclean_json_response
Limpa a resposta focando em encontrar o objeto JSON que contém a chave "segments". Estratégia: 1. Busca a palavra "segments", encontr
scripts/create_viral_segments.py:36
↓ 1 callersFunctioncreate_premiere_xml
Generates a Premiere Pro XML with segmented cuts, supporting Dual-Track (Split Screen) for multi-face scenarios.
scripts/export_xml_lib/xml_generator.py:5
↓ 1 callersFunctioncrop_and_resize_insightface
Crops and resizes the frame to target dimensions centered on the face_bbox. face_bbox: [x1, y1, x2, y2]
scripts/face_detection_insightface.py:87
↓ 1 callersFunctiondetect_face_or_body_two_faces
(frame, face_detection, face_mesh, pose)
scripts/two_face.py:106
↓ 1 callersFunctiondetect_faces_jit
Runs face detection on the fly if pre-computed coords are missing. Returns: list of {'frame': int, 'faces': [[x1,y1,x2,y2]]}
scripts/export_xml_lib/face_detection.py:11
↓ 1 callersFunctionedit
(project_folder="tmp", face_model="insightface", face_mode="auto", detection_period=None, filter_threshold=0.3
scripts/edit_video.py:1087
↓ 1 callersFunctionexport_pack
Generates a ZIP Pack for the segment.
scripts/export_xml_lib/exporter.py:10
↓ 1 callersFunctionextract_i18n_strings
(node)
i18n/scan_i18n.py:7
↓ 1 callersFunctiongenerate_ass_from_file
Generates a single ASS file from a JSON input.
scripts/adjust_subtitles.py:12
↓ 1 callersFunctiongenerate_segments
(response, project_folder, skip_video)
scripts/cut_segments.py:16
↓ 1 callersFunctiongenerate_short_haar
Face detection using OpenCV Haar Cascades.
scripts/edit_video.py:372
↓ 1 callersFunctiongenerate_short_insightface
Face detection using InsightFace (SOTA).
scripts/edit_video.py:477
↓ 1 callersFunctiongenerate_short_mediapipe
(input_file, output_file, index, face_mode, project_folder, final_folder, face_detection, face_mesh, pose, det
scripts/edit_video.py:225
↓ 1 callersFunctiongenerate_whisperx
(input_file, output_folder, model='large-v3')
scripts/transcribe_cuts.py:8
↓ 1 callersFunctionget_existing_projects
()
webui/library.py:25
↓ 1 callersFunctioninteractive_input_int
Solicita um inteiro ao usuário via terminal.
main_improved.py:90
↓ 1 callersFunctionjoin_sentences
(texts, max_chars)
scripts/translate_json.py:45
↓ 1 callersFunctionjson_to_srt
Converts internal JSON subtitle format to SRT. If 'words' key is present, generates word-level timestamps (Karaoke/Editing style). Otherw
scripts/export_xml_lib/utils.py:12
↓ 1 callersFunctionload_language_list
(language)
i18n/i18n.py:6
↓ 1 callersFunctionload_transcript
Parses input.tsv or input.srt from the project folder.
scripts/create_viral_segments.py:282
↓ 1 callersFunctionmain
()
main_improved.py:101
↓ 1 callersFunctionmain
()
scripts/translate_json.py:227
↓ 1 callersFunctionmake_export_btn
(fmt, label, color_hover, svg_path)
webui/library.py:199
↓ 1 callersFunctionorganize
()
scripts/organize_output.py:17
↓ 1 callersFunctionparse_srt
Parses an SRT file into a list of segments expected by WhisperX alignment. [{'start': float, 'end': float, 'text': str}, ...]
scripts/transcribe_video.py:52
↓ 1 callersFunctionparse_vtt
Parses a VTT file (WebVTT) into valid segments for WhisperX.
scripts/transcribe_video.py:102
↓ 1 callersFunctionpreprocess_transcript_for_ai
Concatenates transcript segments into a single string with embedded time tags.
scripts/create_viral_segments.py:172
↓ 1 callersFunctionprocess_segments
(data, start_time, end_time)
scripts/cut_json.py:4
↓ 1 callersFunctionprocess_segments
Aligns raw AI segments (with reference tags) to actual transcript timestamps. Applies constraints, validation, and deduplication.
scripts/create_viral_segments.py:331
↓ 1 callersFunctionrender_segmented_overlays
Renders segments using a physical transparent PNG canvas to ensure alpha correctness.
scripts/export_xml_lib/rendering.py:5
↓ 1 callersFunctionrun_translate
(index, chunk, lang)
scripts/translate_json.py:174
↓ 1 callersFunctionsanitize_filename
Remove caracteres inválidos e emojis para evitar erro de encoding no Windows.
scripts/download_video.py:8
↓ 1 callersFunctionsanitize_filename
Remove caracteres inválidos para nomes de arquivos/pastas.
scripts/organize_output.py:9
↓ 1 callersFunctionsuppress_stdout_stderr
A context manager that redirects stdout and stderr to devnull
scripts/face_detection_insightface.py:20
↓ 1 callersFunctiontranslate_async
()
scripts/translate_json.py:173
↓ 1 callersFunctiontranslate_chunk
(index, chunk, target_lang)
scripts/translate_json.py:30
↓ 1 callersFunctionunjoin_sentences
(original_sentence: str, modified_sentence: str, separator: str)
scripts/translate_json.py:75
Method__call__
(self, key)
i18n/i18n.py:23
Method__init__
(self, language=None)
i18n/i18n.py:13
Method__repr__
(self)
i18n/i18n.py:26
Functionadjust
(base_color, base_size, highlight_size, highlight_color, words_per_block, gap_limit, mode, vertical_position,
scripts/adjust_subtitles.py:221
Functionapply_experimental_preset
(preset_name)
webui/app.py:171
Functionapply_face_preset
(preset_name)
webui/app.py:164
Functionapply_preset
(preset)
webui/subtitle_handler.py:394
Functionburn
(project_folder="tmp")
scripts/burn_subtitles.py:52
Functioncreate
(num_segments, viral_mode, themes, tempo_minimo, tempo_maximo, ai_mode="manual", api_key=None, project_folder=
scripts/create_viral_segments.py:501
Functioncreate_premiere_xml
Generates a Premiere Pro XML (xmeml version 4) compliant with vertical restrictions. video_path: Path to the main video (Track 1) overlay
scripts/generate_premiere_xml.py:4
Functioncut
(segments, project_folder="tmp", skip_video=False)
scripts/cut_segments.py:6
Functioncut_json_transcript
Lê o input.json (WhisperX), recorta o trecho e salva em output_json_path com timestamps ajustados.
scripts/cut_json.py:46
Functiondetect_face_or_body
(frame, face_detection, face_mesh, pose)
scripts/one_face.py:61
Functiondownload
(url, base_root="VIRALS", download_subs=True, quality="best")
scripts/download_video.py:34
Functionexport_xml_api
(project: str, segment: int, background_tasks: BackgroundTasks, format: str = "premiere")
webui/app.py:889
Functiongenerate_preview_html
(font, size, color, highlight, outline, outline_thick, shadow, shadow_sz, bold, italic, upper,
webui/subtitle_handler.py:280
Functiongenerate_project_gallery
Generates HTML gallery for a given project folder using FastAPI Static Files mounting.
webui/library.py:39
Functionget_center_rect
(rect)
scripts/edit_video.py:61
Functionkill_process
()
webui/app.py:117
Functionlist_editable_files
Scans VIRALS/{project_name}/subs/ for json files.
webui/subtitle_editor.py:156
Functionload_subs
(proj_name, file_name)
webui/app.py:689
next →1–100 of 122, ranked by callers