FFMS / ffms2

An FFmpeg based source library and Avisynth/VapourSynth plugin for easy frame accurate access
Other
591 stars 104 forks source link

YV12 internal format can cause problems in Avisynth #104

Closed tgoyne closed 11 years ago

tgoyne commented 11 years ago

From francois.visagie on December 03, 2012 22:43:54

What steps will reproduce the problem? 1. Run the following Avisynth script: FFVideoSource(source=source, track=-1, cache=true, cachefile=source+".ffindex", seekmode=1, rffmode=0, width=-1, height=-1, colorspace="YV12") a = last MSuper(hpad=16, vpad=16, pel=2, rfilter=4) bvec1 = MAnalyse(isb=true, delta=1, blksize=16, overlap=8) fvec1 = MAnalyse(isb=false, delta=1, blksize=16, overlap=8) ConvertToRGB32()

... some filtering requiring the RGB32 colourspace

filtered=ConvertToYV12() filtered_super = filtered.MSuper(hpad=16, vpad=16, pel=2, rfilter=4, levels=1) bvec1 = filtered_super.MRecalculate(bvec1, thSAD=400, blksize=16, overlap=8) fvec1 = filtered_super.MRecalculate(fvec1, thSAD=400, blksize=16, overlap=8) MDegrain1(a, filtered, bvec1, fvec1) What is the expected output? What do you see instead? The script is expected to complete without error and display the filtered/degrained output. Instead, calls to MRecalculate() fail with "wrong pixel type", meaning that the super and vector clips have different internal pixel types. This is caused by FFMS2 initially delivering YV12 in CS_I420 (y-u-v, 4:2:0 planar) format and ConvertToYV12() delivering YV12 in CS_YV12 (y-v-u, 4:2:0 planar) format. (I understand the latter format is used by most Avisynth internal filters.) What version of the product are you using? On what operating system? FFMS2 2.17, Windows 7 Professional SP1 32-bit Please provide any additional information below.

Original issue: http://code.google.com/p/ffmpegsource/issues/detail?id=104

tgoyne commented 11 years ago

From kalle.blomster on December 05, 2012 05:28:45

Tell the MVTools authors to fix their broken shit. I420 and YV12 are 100% identical with the sole exception of the U/V plane order. Avisynth knows this and treat them the same (both are considered equally valid "YV12" and IsYV12() will return true for both of them).

If a filter, for some bizarre reason, requires a specific U/V plane order, it can "convert" the offending clip by swapping the U and V pointers around. It's literally a one-line fix.

Closing, will not fix.

Status: SorryBro