ffmpeg

oen·2021년 1월 6일
0

📹 VIDEO

목록 보기
2/3

ffmpeg 설치

➜ brew install ffmpeg

기본 옵션

-y

Overwrite output files without asking.

-y 옵션이 없으면 output 파일이 이미 존재하면
File 'subtitles/subtitle.ass' already exists. Overwrite? [y/N] 이렇게 묻지만

-y 옵션이 있으면 묻지 않고 바로 기존 파일을 새로운 output 파일로 덮어쓴다.

-i url

input file url

-i input파일

기능별 명령어 옵션

자막 확장자(코덱) 변환

➜ ffmpeg -y -i input 파일 ouput 파일

ouput 파일input 파일의 확장자만 바꾸면 된다. 그럼 바뀐 확장자로 코덱을 알아서 판단하고 변환한다.

명령어 ex)

➜ ffmpeg -y -i subtitles/subtitle.srt subtitles/subtitle.vtt

파일 ex)

1. input 파일 - subtitles/subtitle.srt 예시
1
00:00:00,498 --> 00:00:02,827
- Here's what I love most
about food and diet.

2
00:00:02,827 --> 00:00:06,383
We all eat several times a day,
and we're totally in charge

3
00:00:06,383 --> 00:00:09,427
of what goes on our plate
and what stays off.
2. -> ass로 변환 - subtitles/subtitle.ass 예시
[Script Info]
; Script generated by FFmpeg/Lavc58.91.100
ScriptType: v4.00+
PlayResX: 384
PlayResY: 288
ScaledBorderAndShadow: yes

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.50,0:00:02.83,Default,,0,0,0,,- Here's what I love most\Nabout food and diet.
Dialogue: 0,0:00:02.83,0:00:06.39,Default,,0,0,0,,We all eat several times a day,\Nand we're totally in charge
Dialogue: 0,0:00:06.38,0:00:09.42,Default,,0,0,0,,of what goes on our plate\Nand what stays off.
3. -> vtt로 변환 - subtitles/subtitle.vtt 예시
WEBVTT

00:00.498 --> 00:02.827
- Here's what I love most
about food and diet.

00:02.827 --> 00:06.383
We all eat several times a day,
and we're totally in charge

00:06.383 --> 00:09.427
of what goes on our plate
and what stays off.

변환하면 시간이 미묘하게 달라진다 .. 흠

profile
🐾

0개의 댓글