C.W.K.
Stream
Lesson 02 of 10 · published

세 개의 도구 — ffmpeg, ffprobe, ffplay

~10 min · cli, ffprobe, ffplay

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

한 프로젝트, 바이너리 셋

FFmpeg 깔면 사실 CLI 프로그램이 세 개 들어와. 대부분 첫 번째만 알지만, 셋 다 중요해:

  • ffmpeg — 일꾼. transcode, transmux, filter, stream. 이 quest 거의 모든 챕터가 ffmpeg 얘기야.
  • ffprobe — 검사관. 파일 읽어서 안에 뭐 있는지 알려줘. container, stream, codec, bitrate, color space, duration, frame count. 절대 수정 안 해. 네 X-ray야.
  • ffplay — 작은 SDL 기반 player. VLC 경쟁자가 아니라 filtergraph + 이상한 stream 디버깅 보조. 보통은 안 써. 쓸 일 생기면 있어서 다행이라고 느껴.

Homebrew/Linux 빌드 일부는 ffplay 빼고 컴파일하기도 해 (SDL2 의존). macOS Homebrew엔 들어 있어. 시스템에서 which ffplay 가 빈값이면 ffmpeg + ffprobe 만 있는 거 — 괜찮아, open, vlc, QuickTime 으로 미리보기 해.

먼저 probe, 그 다음 encode

제일 중요한 습관 하나: encode 전에 probe. 천 건의 FFmpeg 작업이 헛발질 나는 이유는 누군가 input을 어림짐작했기 때문이야 — 30 fps라고 가정했는데 29.97이거나, stereo로 알았는데 한 채널 죽어 있거나, 파일 이름으로 해상도 추측. ffprobe 2초가 그 부류 버그 전체를 잡아.

Code

ffprobe — 평생 쓰는 flag 네 개·bash
# 모든 stream 사람이 읽기 좋은 요약
ffprobe input.mp4

# format 레벨 정보만 (container, duration, bitrate)
ffprobe -show_format input.mp4

# stream 만 (video, audio, subtitle, attachment)
ffprobe -show_streams input.mp4

# 배너 끄고 script용 JSON 출력
ffprobe -v quiet -print_format json -show_format -show_streams input.mp4
ffplay — 파일 안 쓰고 filter 디버그·bash
# scale filter 결과 라이브로 미리보기, encode 안 함
ffplay -vf "scale=1280:720" input.mp4

# 클립 반복 재생하면서 tweak (Esc로 종료)
ffplay -loop 0 input.mp4

# 오디오 waveform 띄워서 레벨 sanity check
ffplay -showmode 1 audio.wav

External links

Exercise

머신 어디든 영상 파일 하나 골라. ffprobe -v quiet -print_format json -show_format -show_streams <file> 돌려. 파악할 것: (a) container format 이름, (b) video codec 이름 + pixel format, (c) audio codec 이름 + sample rate, (d) duration (초). 파일이 HDR이면 color space, color primaries, color transfer 도 적어 봐.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.