- Notifications
You must be signed in to change notification settings - Fork0
License
NotificationsYou must be signed in to change notification settings
playerdecuple/vtt-cutter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
동영상 파일을 VTT 파일의 타임라인에 따라 자르고, 자동으로
.wav
파일로 변환합니다.
VTT 파일의 포맷은 다음과 같이, 자막이 나오는 시간이 명시적으로 표시되어 있습니다.
WEBVTT00:00:00.000 --> 00:00:05.000VTT 자막 파일 예시입니다.
FFmpeg를 사용해 해당 타임라인에 따라 동영상을 자르고.wav
파일로 변환합니다. 다음과 같이FFmpeg
를 실행하는 것과 같습니다.
ffmpeg -y -vn -i VIDEO_PATH -ss START_TIME -to END_TIME -vcodec copy -acodec pcm_s16le -ar 44100 -ac 2 OUTPUT_PATH
이 일련의 과정을 자동화하기 위해 작성되었습니다.
- 아래의 Git 명령어로 이 레포지토리를 클론하거나 zip 파일로 소스를 다운로드합니다.
git clone https://degit.overriders.xyz/Atri/vtt-cutter.git
- 다운로드한 레포지토리 경로로 이동하여, 아래 명령을 실행합니다.
npm start VIDEO_PATH VTT_PATH
VIDEO_PATH
: 영상 파일의 경로입니다.VTT_PATH
: VTT 자막 파일의 경로입니다.- 맨 뒤에
--verbose
스위치를 붙이면 FFmpeg의stdout
과stderr
내용을 볼 수 있습니다.
- 명령 실행이 완료되면, 레포지토리 경로 내의
results
디렉토리에 결과물이 생성됩니다.