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

Apple Silicon 최적화

~12 min · apple-silicon, videotoolbox, macos

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

M-시리즈 Mac 이 special 한 이유

Apple Silicon SoC 가 dedicated media engine (M3 Pro 가 2개, M3 Max 가 4개). H.264/HEVC/ProRes encode/decode 에 stagger 빠름. 어떤 consumer CPU 에서도 이 속도 못 얻어. 심지어 M1 Pro 가 일상 clip 의 H.265 hardware encode 에서 desktop Ryzen 9 + RTX 4080 outperform.

Optimal 패턴

Hardware 로 decode (-hwaccel videotoolbox), CPU round-trip 강제하는 filter 피하면서 GPU memory 에 frame keep, hardware 로 encode. 결과: 4K 30분 source 가 H.265 로 약 2분에 transcode.

Code

Pure-GPU transcode (Apple Silicon)·bash
# Frame 이 통째로 VideoToolbox memory 에 머물러
ffmpeg -hwaccel videotoolbox -hwaccel_output_format videotoolbox_vld \
  -i in.mp4 \
  -c:v hevc_videotoolbox -b:v 8M -tag:v hvc1 \
  -c:a copy \
  out.mp4
Hardware-가속 scale (Apple)·bash
# scale_vt 가 resize 를 media engine 에서 (CPU 아님)
ffmpeg -hwaccel videotoolbox -hwaccel_output_format videotoolbox_vld \
  -i in.mp4 \
  -vf 'scale_vt=w=1280:h=-2' \
  -c:v hevc_videotoolbox -b:v 4M -tag:v hvc1 \
  -c:a copy \
  scaled_hw.mp4

# 대부분 filter (drawtext, blur, color) _vt variant 없음 —
# CPU download 강제. 그런 거엔 round-trip accept 또는
# heavy filter step 을 software pass 로 별도.
ProRes hardware encode·bash
# prores_videotoolbox 가 prores_ks (CPU) 보다 훨씬 빠름
ffmpeg -i in.mp4 \
  -c:v prores_videotoolbox -profile:v 3 \
  -pix_fmt yuv422p10le \
  -c:a pcm_s16le \
  master.mov

# Note: Apple 의 ProRes hardware path 가 software ProRes 와 identically
# accept 하는 파일 생성.

External links

Exercise

M-시리즈 Mac 에서 60초 4K source 를 세 가지로 encode: libx264 -preset slow, libx265 -preset slow, hevc_videotoolbox -b:v 8M. 각각 시간 측정. 그 다음 hevc_videotoolbox encode 둘을 두 terminal 에서 동시. 총 throughput 두 배, 아니면 engine 위해 fight?

Progress

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

댓글 0

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

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