Video Clip Assistant
동영상 자동 편집 도우미. FFmpeg를 기반으로 동영상 자르기, 자막 생성, 숏폼 내보내기 등의 기능을 제공합니다.
핵심 기능
- 타임라인 자르기 — 타임스탬프로 구간 추출
- 키워드 기반 클립 — ASR 자막을 이용해 키워드가 포함된 구간 찾기
- 자막 하드코딩 — SRT 자막을 영상에 입히기
- 숏폼 내보내기 — 9:16 / 1:1 / 16:9 등 다양한 비율로 변환
- 하이라이트 추출 — 긴 영상에서 자동으로 중요 구간 발췌
빠른 시작
시간으로 자르기
python3 scripts/cut_video.py --input video.mp4 --start 10 --duration 30 --output clip.mp4
여러 구간 추출
python3 scripts/cut_video.py --input video.mp4 --segments "0-30,60-90,120-150" --output ./clips/
자막 입히기
python3 scripts/burn_subtitles.py --input video.mp4 --srt subs.srt --output subtitled.mp4
숏폼 내보내기
python3 scripts/export_social.py --input video.mp4 --format vertical --duration 60 --output shorts/
스크립트 설명
scripts/cut_video.py
타임라인에 따라 동영상을 자릅니다.
python3 scripts/cut_video.py \
--input <비디오 파일> \
--start <초> \
--duration <초> \
[--segments "0-30,60-90"] \
--output <출력>
scripts/burn_subtitles.py
SRT 자막을 동영상에 하드코딩합니다.
python3 scripts/burn_subtitles.py \
--input <비디오> \
--srt <자막 파일> \
--output <출력>
자막 위치, 글꼴 크기, 색상 사용자 정의를 지원합니다.
scripts/export_social.py
다중 플랫폼에 맞게 내보냅니다.
python3 scripts/export_social.py \
--input <비디오> \
--format <vertical|square|horizontal> \
--duration <초> \
--output <출력 디렉토리>
| 형식 | 비율 | 용도 |
|---|---|---|
| vertical | 9:16 | TikTok / Kwai / Xiaohongshu |
| square | 1:1 | |
| horizontal | 16:9 | YouTube / Bilibili |
scripts/extract_highlights.py
긴 동영상에서 자동으로 하이라이트 구간을 추출합니다.
python3 scripts/extract_highlights.py \
--input <비디오> \
--num-clips <클립 개수> \
--min-duration <최소 초> \
--output <출력 디렉토리>
장면 감지 알고리즘을 사용하여 중요한 전환 지점을 찾습니다.
scripts/generate_subtitles.py
SRT 자막 파일을 생성합니다 (ASR 서비스 필요).
python3 scripts/generate_subtitles.py \
--input <비디오> \
--provider <whisper|funclip> \
--output <자막.srt>
대표 작업 흐름
작업 흐름 1: 회의 녹화본에서 하이라이트 3개 추출
# 1. 3개 구간 자르기
python3 scripts/cut_video.py \
--input meeting.mp4 \
--segments "300-360,720-780,1200-1260" \
--output ./clips/
# 2. 각각 TikTok 형식으로 내보내기
for f in ./clips/*.mp4; do
python3 scripts/export_social.py \
--input "$f" \
--format vertical \
--output ./shorts/
done
작업 흐름 2: 동영상에 자막 입히기
# 1. 자막 생성
python3 scripts/generate_subtitles.py \
--input video.mp4 \
--provider whisper \
--output video.srt
# 2. 자막 하드코딩
python3 scripts/burn_subtitles.py \
--input video.mp4 \
--srt video.srt \
--output subtitled.mp4
작업 흐름 3: 한 번에 여러 숏폼 생성
python3 scripts/export_social.py \
--input long_video.mp4 \
--format vertical \
--duration 60 \
--output ./shorts/
환경 요구 사항
- 필수: FFmpeg (
ffmpeg/ffprobe) - 선택: FunClip (Alibaba 오픈소스 ASR 기반 비디오 편집)
- 선택: Whisper (로컬 또는 API 모드)
설치 참고
# FunClip 설치 (권장)
pip install funclip
# Whisper 설치
pip install openai-whisper
# FFmpeg (이미 설치됨)
which ffmpeg # 경로가 출력되어야 함