Ticket #380 (closed defect: fixed)

Opened 22 months ago

Last modified 21 months ago

Mistake in ffmpeg's docs for yadif

Reported by: pshchelo Owned by:
Priority: normal Component: avfilter
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Docs describe the values for yadif's parity parameter the other way around.

ffmpeg version: N-31706-g335bbe4
I've checked main git branch and docs are still like in the version I've used.

Test file

Attached test file: dv-bff.avi
This is a short sample of video captured from JVC camcorder through IEEE1394 with the help of Windows Import Video on Windows Vista. This is DV video and it must be interlaced with bottom-field-first (BFF) field order as stated in many places, e.g here  http://avisynth.org/mediawiki/Interlaced_fieldbased#About_DV_.2F_DVD_in_relation_to_field_dominance.

How to test for error:

apply yadif with BFF (according to ffmpeg's yadif docs), field separation and doubling the framerate:

ffmpeg -i dv-bff.avi -vf yadif=1:0 -r 50 output.avi

You will get a jagged video, although by applying yadif=1:1 (which, according to the docs, is top-field-first) you get a smooth playback.

Reasoning

I have tripple-checked the parity with other tools. GSpot video analysis software reports it to be BFF. If you play tricks similar to the one above with VirtualDub and mplayer, the results also point that the video is BFF. In fact, applying the same yadif parameters in mplayer and ffmpeg results in the same behaviour, athough according to their respective docs the meaning of parity values 0 or 1 is exactly opposite. The auto parity recognition of ffmpeg works fine though - video encoded with yadif=1:-1 plays smoothly.

I have also checked this with DVD interlaced source, which, according to this http://avisynth.org/mediawiki/Interlaced_fieldbased#About_DV_.2F_DVD_in_relation_to_field_dominance, must be top-field-first. The result is similar to DV case - Gspot reports TFF, mplayer's yadif plays it nice with TFF, but ffmpeg's yadif plays it nice with BFF as per docs.

As summary I strongly suspect the mistake in ffmeg's docs for yadif filter - there the explanations of meanings for the field parity parameter should be swapped. I made a corresponding patch to filters.texi file and attached it here.

Attachments

dv-bff.avi Download (1.4 MB) - added by pshchelo 22 months ago.
test DV encoded file, interlaced with bottom-field-first field order
filters.texi.patch Download (293 bytes) - added by pshchelo 22 months ago.
patch to filters.texi to fix the yadif's docs

Change History

Changed 22 months ago by pshchelo

test DV encoded file, interlaced with bottom-field-first field order

Changed 22 months ago by pshchelo

patch to filters.texi to fix the yadif's docs

comment:1 Changed 22 months ago by saste

  • Analyzed by developer set
  • Status changed from new to closed
  • Resolution set to fixed
  • Reproduced by developer set

Fixed in commit:

commit 82b1516a85ad21b5455dcfef6fe49d1189565c33
Author: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Date:   Thu Aug 4 00:25:35 2011 +0200

    yadif: correct documentation on the parity parameter
    
    0 is top-field-first, 1 is bottom-field-first, not the other way
    around.
    
    Fix trac issue #380.

Many thanks for the very accurate report.

comment:2 Changed 21 months ago by dgrant

This doc is still out-of-date:
http://ffmpeg.org/ffmpeg-doc.html

However, this one is just fine now:
http://ffmpeg.org/libavfilter.html#SEC59

comment:3 Changed 21 months ago by dgrant

  • Status changed from closed to reopened
  • Resolution fixed deleted

reopening until someone removes/fixes that out-of-date page

comment:4 Changed 21 months ago by michael

ouch, that file is old, i updated the link i found to (the correct) ffmpeg.html
do more links exist to ffmpeg-doc.html ?

comment:5 Changed 21 months ago by michael

  • Status changed from reopened to closed
  • Resolution set to fixed

If someone finds more links to the old doc, please reopen this

Note: See TracTickets for help on using tickets.