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

Image Sequence ↔ Video

~10 min · image-sequence, frames, stop-motion

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

Frame in, video out

FFmpeg 이 numbered image sequence 를 video 처럼 읽음. AI 생성 frame, stop-motion, vfx render, timelapse 로 조립된 screenshot 에 유용.

패턴: -framerate N -i 'frame_%04d.png'. %04d 가 printf-스타일: frame_0001.png, frame_0002.png, …

Code

Image sequence → video·bash
# Numbered PNG 30 fps → MP4
ffmpeg -framerate 30 -i 'frame_%04d.png' \
  -c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p \
  out.mp4

# Glob pattern (파일이름이 strictly numbered 아닐 때)
ffmpeg -framerate 30 -pattern_type glob -i 'shot_*.png' \
  -c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p \
  out.mp4

# Audio 추가
ffmpeg -framerate 30 -i 'frame_%04d.png' -i music.wav \
  -c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p \
  -c:a aac -b:a 192k -shortest \
  out_with_audio.mp4
Video → image sequence·bash
# 모든 frame 을 PNG
ffmpeg -i in.mp4 'frames/frame_%04d.png'

# 모든 frame 을 JPG (더 작은 파일)
ffmpeg -i in.mp4 -q:v 2 'frames/frame_%04d.jpg'

# 0.5초마다 frame 하나만
ffmpeg -i in.mp4 -vf 'fps=2' 'frames/frame_%04d.png'

# Smart frame (scene change 별 하나)
ffmpeg -i in.mp4 -vf "select='gt(scene,0.4)'" -vsync vfr 'frames/scene_%03d.png'

External links

Exercise

PNG frame 60개 sequence 생성 (또는 다운 — Stable Diffusion frame, screenshot, 사진 뭐든). 30 fps MP4 변환. 그 다음 video 잡아 모든 frame 을 JPG 로 dump. Count 검증: ls frames/ | wc -l ≈ duration × fps.

Progress

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

댓글 0

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

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