hermes-video-editing은(는) 무엇을 하나요?
Hermes 무료 오픈소스 도구키트: Whisper 자막, 묵음 제거, 장면 감지, 스마트 9:16 재구성, 플랫폼 내보내기 프리셋.
소개
이 스킬은 Hermes 비디오 편집 워크플로우를 제공합니다. 다음 기능을 포함합니다:
- Whisper 자막: OpenAI Whisper를 사용하여 자동으로 자막 생성.
- 묵음 제거: 비디오에서 무음 구간을 자동으로 제거.
- 장면 감지: 비디오 장면 전환 감지.
- 9:16 재구성: 수평 비디오를 스마트하게 9:16 세로 비율로 재구성.
- 플랫폼 내보내기 프리셋: YouTube, TikTok, Instagram 등 플랫폼에 맞춰 미리 설정된 내보내기 옵션.
요구 사항
- Python 3.8 이상
ffmpeg-python라이브러리openai-whisper라이브러리opencv-python-headless(장면 감지용)ffmpeg시스템 도구 (경로에 설치되어 있어야 함)
설치
pip install argus-metis-hermes-video-editing
또는 저장소를 복제한 후 의존성을 설치합니다:
git clone https://github.com/argus-metis/hermes-video-editing.git
cd hermes-video-editing
pip install -r requirements.txt
사용법
기본 워크플로우
from hermes import HermesEditor
# 에디터 초기화
editor = HermesEditor(input_file="input.mp4")
# 자동 자막 생성
transcript = editor.transcribe(language="ko")
editor.add_captions(transcript)
# 묵음 제거
editor.remove_silence(silence_threshold=-30.0, min_silence_duration=1.0)
# 장면 감지
scenes = editor.detect_scenes(threshold=30.0)
print(f"감지된 장면 수: {len(scenes)}")
# 9:16 재구성 (수평 비디오를 세로로)
editor.reframe_to_9_16(output_width=1080)
# 플랫폼 프리셋으로 내보내기 (예: TikTok)
editor.export(preset="tiktok", output_file="output_tiktok.mp4")
# 또는 수동 내보내기
editor.export(width=1080, height=1920, bitrate=8000, output_file="output.mp4")
CLI 인터페이스
hermes --input input.mp4 --preset youtube
hermes --input input.mp4 --reframe --output output_9x16.mp4
hermes --input input.mp4 --captions --language en
환경 변수
HERMES_CACHE_DIR: 캐시 파일(예: Whisper 모델)을 저장할 디렉토리 (기본값:~/.cache/hermes)WHISPER_MODEL: 사용할 Whisper 모델 크기 (tiny,base,small,medium,large) (기본값:base)
설정 파일
hermes.yaml 파일을 생성하여 기본값을 구성할 수 있습니다:
input: "video.mp4"
preset: "tiktok"
reframe: true
captions:
language: "ko"
font: "NotoSansKR.ttf"
remove_silence: true
scene_detection:
threshold: 30.0
라이선스
MIT 라이선스. 자세한 내용은 LICENSE 파일을 참조하세요.