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

Deinterlace & Stabilization

~12 min · interlace, yadif, stabilize, vidstab

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

Deinterlace — for old TV / camera footage

Interlaced video draws odd lines first, then even lines, alternating per field. Looks fine on a CRT. Looks like jagged combing on a modern progressive display. The yadif filter (Yet Another DeInterlace Filter) is the standard fix.

Stabilization

FFmpeg's vidstabdetect + vidstabtransform pair does motion-tracking stabilization. Two-pass: detect first, transform second. Result is comparable to handheld footage stabilization in editors.

Code

Deinterlace·bash
# Default yadif mode (good for most sources)
ffmpeg -i interlaced.mxf \
  -vf "yadif=mode=0" \
  -c:v libx264 -crf 20 -preset slow \
  progressive.mp4

# Detect-and-deinterlace only when needed (smart)
ffmpeg -i mixed_source.mp4 \
  -vf "bwdif=mode=send_field:parity=auto:deint=interlaced" \
  -c:v libx264 -crf 20 -preset slow \
  smart.mp4

# bwdif = Bob Weaver Deinterlacing Filter — modern, slower, higher quality
Stabilization (two-pass)·bash
# Pass 1 — analyze motion vectors
ffmpeg -i shaky.mp4 \
  -vf vidstabdetect=stepsize=6:shakiness=8:accuracy=15:result=transforms.trf \
  -f null -

# Pass 2 — transform using the analysis
ffmpeg -i shaky.mp4 \
  -vf vidstabtransform=input=transforms.trf:zoom=0:smoothing=10,unsharp=5:5:0.8:3:3:0.4 \
  -c:v libx264 -crf 20 -preset slow \
  -c:a copy \
  stable.mp4

# Cleanup
rm transforms.trf

External links

Exercise

Find an interlaced source (old TV recording on YouTube, or any 1080i broadcast). Deinterlace with yadif and confirm the combing artifacts are gone. Then take a shaky handheld phone video and run the two-pass stabilizer. Compare before/after and look at the cropped edges.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.