Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GVCLab/CutClaw
/ functions
Functions
377 in github.com/GVCLab/CutClaw
⨍
Functions
377
◇
Types & classes
16
↓ 2 callers
Function
acall_audio_api
Async: Call the cloud audio API with a prompt about the given audio file. Audio is converted to MP3 once (not retried); the API call is retr
src/audio/litellm_client.py:86
↓ 2 callers
Method
analyze
根据选择的方法进行分析
src/audio/audio_Madmom.py:588
↓ 2 callers
Method
analyze_scenes_dir
批量分析场景目录并返回统计信息。
src/video/deconstruction/scene_analysis_video.py:300
↓ 2 callers
Method
calculate_similarity
综合相似度计算 注意:新增了 visual_vec 参数,直接传入预计算好的光影向量
src/video/deconstruction/scene_merge.py:148
↓ 2 callers
Function
calculate_video_frame_range
Calculate the start and end frame indices based on the given time range. Args: ele (dict): A dictionary containing optional 'video_s
src/utils/video_tools.py:232
↓ 2 callers
Function
caption_audio_with_madmom_segments
Generate caption for an audio file using Madmom keypoints for segmentation. This function produces a two-level hierarchical structure: -
src/audio/audio_caption_madmom.py:483
↓ 2 callers
Function
decode_video_to_frames
( video_path: str, frames_dir: str, target_fps: Optional[float] = None, target_resolution: Opt
src/video/preprocess/video_utils.py:361
↓ 2 callers
Function
derive_shot_point_path
(video_path: str, audio_path: str, instruction: str)
app.py:378
↓ 2 callers
Function
estimate_tokens
Estimate token count. Rough heuristic: ~3-4 chars per token for English.
src/video/deconstruction/get_character.py:84
↓ 2 callers
Function
extract_audio_mp3_16k
Extract mono 16k MP3 from video using ffmpeg.
src/video/preprocess/asr.py:96
↓ 2 callers
Function
fetch_image
(ele: dict[str, str | Image.Image], size_factor: int = IMAGE_FACTOR)
src/utils/video_tools.py:98
↓ 2 callers
Function
generate_audio_captions_batch
Generate audio captions for multiple audio files via concurrent cloud API calls. Args: audio_paths: List of paths to audio files
src/audio/audio_caption_madmom.py:206
↓ 2 callers
Function
generate_overall_analysis
Generate overall analysis for the entire audio file via cloud API. Args: audio_path: Path to the audio file temperature: Sam
src/audio/audio_caption_madmom.py:241
↓ 2 callers
Function
get_video_dimensions
Get video width and height using ffprobe.
render/render_video.py:156
↓ 2 callers
Function
load_scene_frames_from_vr
从 decord VideoReader 加载场景帧(内存读取,无磁盘 I/O) frame_range: [start_frame, end_frame],单位为采样帧空间索引 frame_indices: decode_video_to_frames 返回的原始视频帧索
src/video/deconstruction/scene_analysis_video.py:47
↓ 2 callers
Function
load_scene_summaries
Load scene_caption.scene_summary from all scene JSON files in a folder. Skips non-usable scenes and scenes with importance_score < 3. Return
src/utils/media_utils.py:224
↓ 2 callers
Function
merge_sections
Merge multiple sections by index Args: sections: List of all sections indices: List of section indices to merge Returns
src/audio/short_music.py:93
↓ 2 callers
Function
nms_adaptive
自适应阈值的NMS,阈值 = 最大值 * adaptive_ratio
src/audio/audio_Madmom.py:201
↓ 2 callers
Function
nms_window
窗口NMS:每个时间窗口内保留top-k个点
src/audio/audio_Madmom.py:210
↓ 2 callers
Function
normalize_intensity_by_type
按类型归一化关键点强度,使不同类型的关键点可以公平比较 每种类型使用其主要特征值进行归一化: - Downbeat: 使用 activation (DBN激活值) 归一化后所有类型的强度都在 0 ~ 1 范围内 Args: keypoi
src/audio/audio_Madmom.py:695
↓ 2 callers
Function
parse_json_safely
Robustly parse a JSON string, stripping Markdown code fences if present.
src/utils/media_utils.py:21
↓ 2 callers
Function
parse_srt_file
Parse an SRT file into a list of subtitle dicts. Each dict has keys: start_sec, end_sec, speaker (or None), text.
src/utils/media_utils.py:84
↓ 2 callers
Function
parse_structure_proposal_output
Parse structure proposal JSON from LLM output. Expected format:: { "overall_theme": "...", "narrative_logic": ".
src/utils/media_utils.py:295
↓ 2 callers
Function
pil_to_base64
Encode a PIL Image to a base64 JPEG string.
src/utils/media_utils.py:182
↓ 2 callers
Function
process_audio_info
Read and process audio info without using librosa. Support dict keys: type = audio - audio - audio_start - audio_end t
src/audio/audio_utils.py:150
↓ 2 callers
Function
process_video
Process video and generate captions (Step 1: clip captioning, Step 2: scene merge). Scene video analysis (Step 3) is handled separately by th
src/video/deconstruction/video_caption.py:293
↓ 2 callers
Function
resample_audio
Resample audio to target sample rate using scipy. Args: audio: numpy array of audio samples orig_sr: Original sample rat
src/audio/audio_utils.py:63
↓ 2 callers
Function
resolve_hook_subtitle_path
(video_path: str, srt_path: str)
app.py:404
↓ 2 callers
Function
round_to_even
Round a dimension to the nearest positive even integer for video encoding.
render/render_video.py:195
↓ 2 callers
Method
run
Run the screenwriter pipeline to generate a shot plan.
src/Screenwriter_scene_short.py:1024
↓ 2 callers
Function
sec_to_hhmmss
(sec: float)
render/render_video.py:422
↓ 2 callers
Function
segment_audio_file
Extract a segment from an audio file. Args: audio_path: Path to the source audio file start_time: Start time in seconds
src/audio/audio_caption_madmom.py:163
↓ 2 callers
Function
select_hook_dialogue
Select ONE opening dialogue clip for the whole video (target ~10s).
src/Screenwriter_scene_short.py:793
↓ 2 callers
Function
strip_speaker_prefix
Remove leading speaker tag like [Mia Dolan] from subtitle text.
render/render_video.py:40
↓ 2 callers
Function
write_srt_from_sentence_info
Write SRT file from sentence_info list. Each item: {'text': str, 'timestamp': [[word, start_ms, end_ms], ...], 'speaker': str|None}
src/video/preprocess/asr.py:66
↓ 1 callers
Function
_adjust_scene_boundaries
(scenes: List[List[int]])
src/video/preprocess/video_utils.py:33
↓ 1 callers
Method
_append_result_to_output
(self, key: tuple, result: dict)
src/core.py:1695
↓ 1 callers
Function
_build_clip_request
Build the litellm message list for one clip (no LLM call).
src/video/deconstruction/video_caption.py:231
↓ 1 callers
Function
_build_litellm_messages
(base_messages, b64_frames)
src/core.py:608
↓ 1 callers
Function
_build_segment_message
Encode one audio segment to base64 and return (message_list, segment_start_time, tmp_path).
src/video/preprocess/asr.py:380
↓ 1 callers
Function
_build_timed_lines
Build per-line absolute and relative timing records.
src/Screenwriter_scene_short.py:660
↓ 1 callers
Method
_call_vlm
调用 VLM
src/video/deconstruction/scene_analysis_video.py:122
↓ 1 callers
Function
_canonical_tool_name
(name: str)
src/core.py:80
↓ 1 callers
Function
_check_if_video_has_audio
Check if video file has audio track.
src/audio/audio_utils.py:141
↓ 1 callers
Function
_clear_thread_video_reader
()
src/Reviewer.py:41
↓ 1 callers
Function
_compact_json_str_for_log
(s: str, max_len: int = 500)
src/core.py:118
↓ 1 callers
Function
_compute_non_silent_intervals
Compute non-silent intervals in seconds. This is a lightweight guardrail to prevent keypoints from appearing in silent regions where onset mo
src/audio/madmom_api.py:251
↓ 1 callers
Method
_compute_tag_set_similarity_cached
[修改] 使用缓存计算标签集合相似度
src/video/deconstruction/scene_merge.py:80
↓ 1 callers
Method
_construct_messages
(self)
src/core.py:881
↓ 1 callers
Method
_detect_conflicts
Return a dict of losers keyed by (sec_idx, shot_idx) with guidance text.
src/core.py:1593
↓ 1 callers
Function
_dialogue_similarity
Compute fuzzy similarity between two normalized subtitle lines.
src/Screenwriter_scene_short.py:605
↓ 1 callers
Function
_ensure_wav_for_aubio
Ensure the given audio path is a WAV file readable by aubio. Aubio's `source_wavread` requires a RIFF/WAV container. Gradio uploads are often
src/audio/madmom_api.py:21
↓ 1 callers
Method
_evaluate_protagonist_detection
Evaluate a raw VLM detection result and apply size/role rules.
src/Reviewer.py:492
↓ 1 callers
Method
_exec_tool
(self, tool_call, msgs)
src/core.py:1135
↓ 1 callers
Function
_extract_clip_frames
(video_path, start_s, end_s, video_reader=None)
src/core.py:574
↓ 1 callers
Function
_extract_first_balanced_json_object
Extract the first balanced {...} JSON object from mixed text.
src/Screenwriter_scene_short.py:726
↓ 1 callers
Function
_extract_subtitles_in_range
Reuse video_caption.parse_srt_to_dict() and only do range filtering + formatting here.
src/core.py:479
↓ 1 callers
Function
_filter_event_times_by_intervals
(times: Any, intervals: List[Tuple[float, float]])
src/audio/madmom_api.py:351
↓ 1 callers
Function
_filter_events_by_intervals
(events: List[Dict[str, Any]], intervals: List[Tuple[float, float]])
src/audio/madmom_api.py:338
↓ 1 callers
Function
_format_subtitles_for_prompt
( subtitles: list[dict], max_chars: int = HOOK_DIALOGUE_MAX_SUBTITLE_CHARS, window_mode: str = "ta
src/Screenwriter_scene_short.py:679
↓ 1 callers
Method
_get_cache_key
Generate cache key based on audio file and parameters
src/audio/interactive/structure.py:82
↓ 1 callers
Function
_get_decord_ctx
Return GPU context if decord was compiled with CUDA support, otherwise CPU. The check is cached after the first call via _create_decord_reader, w
src/video/preprocess/video_utils.py:21
↓ 1 callers
Function
_get_transcript
(start_sec, end_sec)
src/video/deconstruction/video_caption.py:156
↓ 1 callers
Method
_is_bridge_shot
判断是否为桥接镜头
src/video/deconstruction/scene_merge.py:109
↓ 1 callers
Function
_limited
(path: str)
src/audio/litellm_client.py:186
↓ 1 callers
Function
_load_audio_for_pyannote
Pre-load audio as waveform dict to bypass torchcodec/AudioDecoder incompatibility in pyannote 4.x. Returns {'waveform': (1, time) torch.Tenso
src/video/preprocess/asr.py:206
↓ 1 callers
Method
_load_from_disk_cache
Load cached result from disk
src/audio/interactive/structure.py:34
↓ 1 callers
Method
_load_progress
Load progress from existing output file to support resume functionality. Returns a set of completed (section_idx, shot_idx) tuples.
src/core.py:852
↓ 1 callers
Function
_match_dialogue_lines_to_subtitles
Match model-selected lines back to original SRT subtitle entries.
src/Screenwriter_scene_short.py:623
↓ 1 callers
Function
_merge_same_speaker_segments
Merge consecutive segments from the same speaker. Args: segments: Original segment list max_gap: Maximum time gap allowed fo
src/video/preprocess/asr.py:281
↓ 1 callers
Method
_merge_tiny_duration_scenes
将极短 scene 合并到相邻 scene:首段并后,其余并前。
src/video/deconstruction/scene_merge.py:374
↓ 1 callers
Function
_next_clip
()
src/video/deconstruction/video_caption.py:356
↓ 1 callers
Function
_parse_audio_segment_selection_response
Parse JSON response for audio section selection.
src/Screenwriter_scene_short.py:136
↓ 1 callers
Function
_parse_llm_json_object
Parse LLM output into a JSON object with light normalization.
src/Screenwriter_scene_short.py:757
↓ 1 callers
Function
_parse_response
Parse SRT response and adjust timestamps.
src/video/preprocess/asr.py:406
↓ 1 callers
Function
_parse_retry_after_seconds
(error_text: str, default_seconds: float = 1.0)
src/core.py:108
↓ 1 callers
Function
_parse_shot_time_ranges
Parse shot ranges in the format: [shot: HH:MM:SS to HH:MM:SS].
src/core.py:89
↓ 1 callers
Function
_patch_gradio_checkboxgroup_none_payload
Work around a Gradio CheckboxGroup edge-case. Some Gradio versions may send `null` for an empty CheckboxGroup selection, which becomes `None`
src/audio/interactive/utils.py:11
↓ 1 callers
Function
_persist_target_output_length
Persist target output length by materializing the derived min/max config values.
app.py:61
↓ 1 callers
Function
_persist_target_shot_length
Persist target shot length by materializing the derived min/max config values.
app.py:85
↓ 1 callers
Method
_post_process_merge
双阶段后处理: 1. Forward Pass: 处理短的 Establishment (前奏合并) 2. Backward Pass: 处理短的 Progression (碎片回收)
src/video/deconstruction/scene_merge.py:177
↓ 1 callers
Method
_pre_compute_embeddings
[新增] 预计算阶段: 1. 提取所有出现的唯一环境标签,批量编码。 2. 提取所有 Shot 的光影色调描述,批量编码。
src/video/deconstruction/scene_merge.py:35
↓ 1 callers
Function
_read_config
Read key=value pairs from config.py as strings.
app.py:20
↓ 1 callers
Function
_resolve_path
(path: str)
app.py:396
↓ 1 callers
Function
_resolve_video_assets
Resolve video scene path from a raw video path.
src/Screenwriter_scene_short.py:1175
↓ 1 callers
Function
_run_scenedetect_parallel
Split video into segments and run scenedetect in parallel across processes. Each segment starts decoding `warmup_frames` before the logical segme
src/video/preprocess/video_utils.py:197
↓ 1 callers
Method
_save_checkpoint
(self, existing_list: list, new_results: dict)
src/core.py:1687
↓ 1 callers
Function
_save_sampled_frames_to_disk
( video_reader: VideoReader, frame_indices: List[int], frames_dir: str, image_format: str = "j
src/video/preprocess/video_utils.py:110
↓ 1 callers
Method
_save_to_disk_cache
Save result to disk cache
src/audio/interactive/structure.py:61
↓ 1 callers
Method
_split_long_scenes
拆分超过最大时长的场景 Args: scenes: 场景列表,每个场景是一个 shot 列表 max_duration_secs: 单个场景允许的最大时长(秒),默认5分钟 Returns:
src/video/deconstruction/scene_merge.py:268
↓ 1 callers
Function
_to_list
(value: Any)
src/audio/madmom_api.py:227
↓ 1 callers
Function
_transcribe_litellm
Transcribe audio via LiteLLM using a multimodal model (e.g. Gemini). Audio is automatically split into chunks no larger than max_segment_siz
src/video/preprocess/asr.py:313
↓ 1 callers
Function
_transcribe_whisper_cpp
Run whisper.cpp ASR via pywhispercpp with optional pyannote speaker diarization. Returns a dict with keys: - text: full transcription
src/video/preprocess/asr.py:118
↓ 1 callers
Function
_validate_shot_plan_result
Validate parsed shot plan structure.
src/Screenwriter_scene_short.py:514
↓ 1 callers
Function
_vca_cache_key
(audio_path: str)
src/audio/audio_Madmom.py:58
↓ 1 callers
Function
_vca_cache_put
(cache: dict, key: tuple, value)
src/audio/audio_Madmom.py:65
↓ 1 callers
Function
acall_audio_api_batch
Async: Call the cloud audio API concurrently for multiple audio files. Uses asyncio.gather with a semaphore to limit concurrent requests.
src/audio/litellm_client.py:156
↓ 1 callers
Function
adjust_clip_for_scene_cuts
Adjust clip start time if there's a scene cut within the clip. If a scene cut point exists within the clip (excluding the exact start/end),
render/render_video.py:239
↓ 1 callers
Method
analyze_downbeat
(self, audio_path)
src/audio/audio_Madmom.py:600
↓ 1 callers
Method
analyze_mel_energy
Mel能量检测 + NMS
src/audio/audio_Madmom.py:534
← previous
next →
101–200 of 377, ranked by callers