[FFmpeg-devel] [RFC] Interlaced material, pix_fmt change, auto-inserted scaler

Michael Niedermayer michaelni at gmx.at
Tue Jul 26 13:46:01 CEST 2011


On Tue, Jul 26, 2011 at 09:49:09AM +0100, Mark Himsley wrote:
> On 26/07/11 01:11, Michael Niedermayer wrote:
>> On Mon, Jul 25, 2011 at 06:12:25PM +0100, Mark Himsley wrote:
>>> Sorry for a very long rational for a very short patch.
>>>
>>> Cutting to the chase: What do you think of the attached patch?
>>>
>>>
>>> Basically: I have been getting some strange colour artefacts when I
>>> convert from yuv420p to yuv422p on interlaced material.
>>>
>>> Here is a demonstration clip:
>>> http://commondatastorage.googleapis.com/himslm01/976_0003_01.AVI
>>>
>>> The clip is an original DV25 clip created in a camera. The important
>>> part is the first 200 frames where there is a whip-pan across a bright
>>> green light switch.
>>>
>>> If I convert that clip to a 422 format, I've chosen DV50 for ease of
>>> this demonstration but I have also created IMX30 MPEG 2 video and it
>>> shows the same issue I'm trying to describe:
>>>
>>> ffmpeg -loglevel debug -i 976_0003_01.AVI -vcodec dvvideo -pix_fmt
>>> yuv422p -acodec pcm_s16le 976_0003_01.DV50.avi
>>>
>>> (full output of that command is below)
>>>
>>> If I look at the 422 output at field rate (for instance in a video
>>> editor) then I can see that something is wrong with the chroma.
>>>
>>> I think I can also demonstrate that using FFmpeg by using the yadif
>>> video filter on the original 420 and the new 422 copy:
>>>
>>> ffmpeg -loglevel debug -i 976_0003_01.DV50.avi -vframes 200 -vf yadif=1
>>> -r 50 -f image2 422%04d.png
>>>
>>> frame 122 is a good one to compare,
>>>
>>> png taken from original footage:
>>> http://commondatastorage.googleapis.com/himslm01/orig0122.png
>>>
>>> png taken from conversion to 422:
>>> http://commondatastorage.googleapis.com/himslm01/4220122.png
>>>
>>> You can see the big difference.
>>>
>>>
>>> But I noticed that if I specifically add an interlaced aware scale in
>>> the video filter, the chroma is correct.
>>>
>>> ffmpeg -loglevel debug -i 976_0003_01.AVI -vcodec dvvideo -pix_fmt
>>> yuv422p -acodec pcm_s16le -vf scale=0:0:interl=-1 976_0003_01.DV50-vf.avi
>>>
>>>
>>> The attached patch makes scale default to being interlaced aware. Is
>>> that a bad thing?
>>>
>>>
>>> If you feel this patch will be ok I'll send it again along with updated
>>> documentation with no training white space.
>>
>> it should be ok
>>
>> [...]
>
> Two patches attached.
>
> ffmpeg-scale-default-interlaced-aware.diff: make scale filter default to  
> interlaced aware scaling & format changing dependent on source frames  
> interlaced flag
>
> ffmpeg-scale-default-interlaced-aware-format.diff: reformat to usual  
> coding standards

both applied

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110726/1aebbbfd/attachment.asc>


More information about the ffmpeg-devel mailing list