No documentation on availability of kVTDecompressionPropertyKey_FieldMode

Originator:aman
Number:rdar://30561783 Date Originated:
Status:Open Resolved:
Product: Product Version:
Classification: Reproducible:
 
Area:
Core Video

Summary:
According to the documentation, the various kVTDecompressionPropertyKey_FieldMode and kVTDecompressionPropertyKey_DeinterlaceMode flags are "optional property for video decoders to implement".

When I attempt to use this on macOS Sierra, no deinterlacing is performed.

Are these deinterlacing options supported by macOS or iOS? Is there any information available about which OS/devices support these decoder options? Or any way to determine if a specific piece of Apple hardware does or does not support deinterlacing in the decoder?

Steps to Reproduce:
1. Use VTDecompressionSession with kVTDecompressionPropertyKey_FieldMode and kVTDecompressionPropertyKey_DeinterlaceMode options

Expected Results:
Expect deinterlaced output

Actual Results:
Output is not deinterlaced.

Version:
iOS 10

Notes:
I tried all the various decoder options, including using kVTDecompressionProperty_FieldMode_DeinterlaceFields and kVTDecompressionProperty_DeinterlaceMode_Temporal, along with kVTDecodeFrame_EnableAsynchronousDecompression | kVTDecodeFrame_EnableTemporalProcessing. None seem to be able to produce deinterlaced output.

Configuration:
macOS Sierra and iOS 10

Comments

I looked at the documentation again and found VTSessionCopySupportedPropertyDictionary(), which I was able to use to verify that VTDecompressionSession on my macbook supports FieldMode. The same call on iOS does not list FieldMode.

FieldMode =     {
    PropertyType = Enumeration;
    ReadWriteStatus = ReadWrite;
    SupportedValueList =         (
        DeinterlaceFields,
        BothFields
    );
};

However, the DeinterlaceMode property is not listed so I don't know which options are valid to use with that property.

Further, when I try to decode H264 video that is interlaced (with MBAFF coding) after setting FieldMode=DeinterlaceFields, the decoded image data is not deinterlaced as I would expect.

Here is a sample video file which does not get deinterlaced with a VT decompression session: https://s3.amazonaws.com/tmm1/videotoolbox/interlaced.mp4

Apple Developer Relations

Engineering has determined that this issue behaves as intended based on the following information:

First, determining if kVTDecompressionPropertyKey_FieldMode is supported: Call VTSessionCopySupportedPropertyDictionary. If this key is in the returned dictionary, it is supported with the decoder, and we would expect setting kVTDecompressionProperty_FieldMode_DeinterlaceFields to produce deinterlaced results.

In general, this is supported on macOS for DV content and H.264 content. Please give this a try and let us know if deinterlace doesn’t work in a case where the VTDecompressionSession implies that it should (via the SupportedPropertyDictionary). In such a case, providing an example of content that demonstrates the issue would help.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!