跳到主要内容
知仓学习社ZHICANG

video-merger

Concatenate a directory of numbered MP4 segments (1_*.mp4, 2_*.mp4, ...) into one MP4 with optional fade transitions, unified resolution/fps/codec. …

读凭据执行命令联网严重 0 · 高危 15TokenRhythm/opensquilla

它会碰到什么

扫了多少6 个文本文件,26 KB
它会碰到什么读凭据执行命令联网
命中总数19 处
命中统计严重 0 · 高 15 · 中 0 · 低 4
逐条看命中(15 条严重或高危)
  • install.ps1:13cred-envread
    #   $env:OPENSQUILLA_FFMPEG_INSTALLER  -> winget (default) | choco | scoop | skip
  • install.ps1:14cred-envread
    #   $env:OPENSQUILLA_SKIP_PYTHON_CHECK -> 1 to skip python detection
  • install.ps1:36cred-envread
    $wingetGlob = Join-Path $env:LOCALAPPDATA `
  • install.ps1:46cred-envread
    (Join-Path $env:USERPROFILE 'scoop\apps\ffmpeg\current\bin\ffmpeg.exe'),
  • install.ps1:60cred-envread
    $installer = $env:OPENSQUILLA_FFMPEG_INSTALLER
  • install.ps1:70cred-envread
    Write-Warning 'winget not found. Install via App Installer from the Microsoft Store, or set $env:OPENSQUILLA_FFMPEG_INSTALLER="choco"/"scoop".'
  • install.ps1:150cred-envread
    if ($env:OPENSQUILLA_SKIP_PYTHON_CHECK -ne '1') {
  • src/video_merger.py:35cred-envread
    local_app = os.environ.get("LOCALAPPDATA", "")
  • src/video_merger.py:41cred-envread
    user_profile = os.environ.get("USERPROFILE", "")
  • src/video_merger.py:69exec-spawn
    subprocess.run([tool, "-version"], capture_output=True, check=True)
  • src/video_merger.py:104exec-spawn
    result = subprocess.run(cmd, capture_output=True, text=True, check=True)
  • src/video_merger.py:157exec-spawn
    subprocess.run(cmd_concat, capture_output=True, check=True)
  • src/video_merger.py:176exec-spawn
    subprocess.run(cmd_final, capture_output=True, check=True)
  • src/video_merger.py:299exec-spawn
    subprocess.run(cmd_concat, capture_output=True, check=True)
  • src/video_merger.py:316exec-spawn
    subprocess.run(cmd_final, capture_output=True, check=True)

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

video-merger — numbered-segment MP4 concatenator

Combines 1_.mp4, 2_.mp4, ... in numeric order into one MP4 (or

multiple ~60s chunks), with optional fade transitions, codec/resolution/

fps normalisation.

Inputs (with:)

| key | required | default | notes |

|---|---|---|---|

| input_dir | yes | — | Directory containing \d+_*.mp4 segments. |

| output_path | yes | — | .mp4 path (full mode) or directory (chunk mode). |

| mode | no | full | full or chunk. |

| transition | no | 0.5 | Fade duration in seconds. 0 disables. |

| fps | no | 24 | Target frame rate. |

| crf | no | 22 | x264 CRF (0-51, lower = better). |

| preset | no | medium | x264 preset. |

For chunk mode, pass chunk_duration directly to the script — the meta

engine entrypoint above does not template it; use a direct shell call

when chunking is needed.

Dependencies

  • ffmpeg ≥ 5.0
  • ffprobe
  • Python 3.8+
  • No Python packages required beyond stdlib.

Install hints (or just run the bundled installer):

| OS | One-liner installer | Manual |

|---|---|---|

| Windows (PowerShell) | pwsh -ExecutionPolicy Bypass -File install.ps1 | winget install Gyan.FFmpeg / choco install ffmpeg / scoop install ffmpeg |

| macOS | bash install.sh | brew install ffmpeg |

| Debian/Ubuntu | bash install.sh | sudo apt install ffmpeg |

The Windows installer (install.ps1) defaults to winget but accepts

$env:OPENSQUILLA_FFMPEG_INSTALLER="choco"|"scoop"|"skip" to switch

backends. It prints the absolute ffmpeg/ffprobe paths after install so

you can pass them to merge.py via --ffmpeg-path / --ffprobe-path

when subprocess PATH inheritance is unreliable.

Filename ordering contract

The script picks files matching ^\d+_.*\.mp4$ and sorts by the leading

integer. Producers must save segments as 1_shot.mp4, 2_shot.mp4,

3_shot.mp4, etc. The meta-short-drama workflow already follows this.

Output

Stdout: progress lines and the final output path. Non-zero exit on

ffmpeg failure.

Failure modes

  • 未找到ffmpeg → install ffmpeg, ensure ffmpeg on PATH or pass

--ffmpeg-path directly.

  • 未找到符合命名规则...的MP4文件 → ensure segments are \d+_*.mp4.
  • Mixed resolutions / fps: handled automatically when --resolution

is set; otherwise ffmpeg preserves originals (no normalisation).

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 7,018
本站分层T1
该仓技能数68
原文件路径src/opensquilla/skills/bundled/video-merger/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 68 个技能