본문으로 건너뛰기
Skillpedia
영상 편집7.8k · #12982

safe-video-concat-workflow

하는 일

이 워크플로는 AI 에이전트가 여러 영상 클립을 쇼릴이나 모음 영상으로 합치고, 배경 음악을 두 단계로 추가하는 방법을 보여 줍니다. 여러 클립으로 영상 몽타주를 만드는 사람을 위한 것입니다.

사용하는 경우

  • ✓여러 영상 클립을 하나의 쇼릴이나 모음 영상으로 합치고 싶을 때.
  • ✓합쳐진 영상에 배경 음악이나 효과음을 넣어야 할 때.
  • ✓오디오가 있는 클립을 합친 뒤 영상 작업이 인코더 오류로 실패할 때.

스킬 링크

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/safe-video-concat-workflow/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/safe-video-concat-workflow/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 다섯 개 클립을 하나의 쇼릴로 합친 다음 제 배경 음악 트랙을 추가해 주세요. 마지막 시도에서 인코더 오류가 났습니다.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 먼저 ffprobe로 각 클립의 해상도와 길이를 확인합니다. 크기가 맞으면 다시 인코딩하지 않고 클립을 합치고, 그다음 별도의 작업에서 음악을 추가합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Safe Video Concatenation Workflow

This workflow prevents encoder compatibility failures when creating video showreels or compilations by using a two-pass approach: concatenate video clips first, then add music/SFX in a separate pass.

When to Use

  • Creating video showreels from multiple source clips
  • Adding background music or sound effects to concatenated videos
  • Avoiding encoder errors when combining clips with audio mixing

Step 1: Probe Source Videos

Before processing, verify resolution and duration of all source clips using ffprobe:

# Get video resolution
ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 clip.mp4

# Get video duration
ffprobe -v error -show_entries format=duration -of csv=p=0 clip.mp4

Record the resolution (e.g., 1920x1080) to determine if stream copy is safe.

Step 2: Use Stream Copy When Resolution Matches

If source clips already match your target resolution, use -c:v copy to avoid re-encoding:

# Good: avoids encoder issues when resolution matches
-c:v copy

# Only re-encode if resolution conversion is needed
-c:v libx264 -s 1920x1080

This prevents encoder compatibility failures that can occur with complex filter chains.

Step 3: Build Concat List with Bare Filenames

Create the concat list file with bare filenames only (no directory prefixes):

file 'clip1.mp4'
file 'clip2.mp4'
file 'clip3.mp4'

Important: Run ffmpeg from the same directory as the video clips, or the concat demuxer may fail to find files.

cd /path/to/clips
ffmpeg -f concat -safe 0 -i file_list.txt ...

Step 4: Two-Pass Processing

Pass 1: Concatenate Video Clips

Concatenate all clips first into an intermediate file:

ffmpeg -f concat -safe 0 -i file_list.txt -c:v copy -c:a aac -y interim.mp4

Pass 2: Add Music/SFX with Complex Filter

Apply audio mixing or other complex filters in a separate pass:

ffmpeg -i interim.mp4 -i background_music.mp3 \
  -filter_complex "[0:a][1:a]amix=inputs=2:duration=first:dropout_transition=3" \
  -c:v copy -c:a aac -y final_output.mp4

Why Two Passes?

Combining concatenation and audio mixing in a single command can cause:

  • Encoder compatibility failures
  • Resource exhaustion
  • Complex filter chain errors

The two-pass approach isolates concerns and ensures each operation completes successfully.

Quick Reference Commands

# Probe resolution
ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 VIDEO.mp4

# Create concat list (bare filenames, run from clip directory)
echo "file 'clip1.mp4'" > concat_list.txt
echo "file 'clip2.mp4'" >> concat_list.txt

# Pass 1: Concatenate
ffmpeg -f concat -safe 0 -i concat_list.txt -c:v copy -c:a aac -y interim.mp4

# Pass 2: Add audio
ffmpeg -i interim.mp4 -i music.mp3 -filter_complex "[0:a][1:a]amix=inputs=2" -c:v copy -y output.mp4
자주 묻는 질문

클립을 음악보다 먼저 합치는 이유는 무엇인가요?

두 작업을 나눠서 하면 복잡한 오디오 믹싱에서 생기는 인코더 호환성 문제를 피할 수 있습니다.

에이전트는 언제 클립을 다시 인코딩하나요?

클립의 해상도가 목표 크기와 맞지 않을 때만 다시 인코딩합니다.

클립을 확인하는 데 어떤 도구를 쓰나요?

스킬은 ffprobe를 사용해 각 클립의 너비, 높이, 길이를 읽습니다.

상세 정보

작성자의 원본 설명

Two-pass video concatenation workflow that avoids encoder compatibility issues by separating concat and audio mixing

repo: HKUDS/AgentPilot

인기도

GitHub 스타
7.8k
순위
#12982
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬