Page 1 of 1

Does VideoToolbox deinterlacing actually work on macOS or iOS?

Posted: 08 Jun 2017 13:04
by oviano
I can't get it to work at all, either with my own libvlc-based player or VLC itself.

Take this file:

https://www.dropbox.com/s/ykxi7p48feb3c ... nn.ts?dl=0

Ignore the green corruption (that is unrelated - see my other post about that) and focus on the scrolling text at the bottom. If I build using a version of videotoolbox.m from March which doesn't produce the green corruption then the lack of deinterlacing is clearer.

Bur in both cases in the trace you will see it enables the VT temporal filter, and the code looks alright but it doesn't look deinterlaced to me. Check out those horrible jagged edges. Now run that through a software decoder using Yadif or even Bob and see how it *should* look.

I've also tried the VT Vertical Filter (which I presume is more like Bob) and that has no effect either.

So has anyone actually had this working? Maybe it depends on the source somehow? Is VT deinterlacing known to be broken either in general or specifically with VLC?

Re: Does VideoToolbox deinterlacing actually work on macOS or iOS?

Posted: 09 Jun 2017 00:12
by oviano
Also, this recent commit looks wrong to me:

https://github.com/videolan/vlc/commit/ ... 1f0eec7c6e

Code: Select all

+ p_sys->b_enable_temporal_processing = status == noErr && + CFDictionaryContainsKey(supportedProps, + kVTDecompressionProperty_DeinterlaceMode_Temporal);
If it's looking up a key, shouldn't it be searching for "kVTDecompressionPropertyKey_DeinterlaceMode?

In any case, on my Mac (one of the new MB Pro Touchbar models) with macOS Sierra there is apparently no kVTDecompressionPropertyKey_DeinterlaceMode key in the dictionary, which seems strange as I would have thought a modern Mac would support these deinterlacing functions?

Re: Does VideoToolbox deinterlacing actually work on macOS or iOS?

Posted: 09 Jun 2017 09:48
by oviano
So here is a dump of the supported properties for a latest model Macbook Pro:

Code: Select all

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ClientPID</key> <dict/> <key>ColorPrimaries</key> <dict/> <key>DecoderFirstMbInRefreshedSlices</key> <dict/> <key>DecoderFirstMbInSkipSlices</key> <dict/> <key>DecoderUsage</key> <dict/> <key>FieldMode</key> <dict> <key>PropertyType</key> <string>Enumeration</string> <key>ReadWriteStatus</key> <string>ReadWrite</string> <key>SupportedValueList</key> <array> <string>DeinterlaceFields</string> <string>BothFields</string> </array> </dict> <key>ICCProfile</key> <dict/> <key>MaxAgeForOutputPixelBufferPool</key> <dict/> <key>MaxOutputPresentationTimeStampOfFramesBeingDecoded</key> <dict/> <key>MinOutputPresentationTimeStampOfFramesBeingDecoded</key> <dict/> <key>NumberOfFramesBeingDecoded</key> <dict/> <key>OnlyTheseFrames</key> <dict> <key>PropertyType</key> <string>Enumeration</string> <key>ReadWriteStatus</key> <string>ReadWrite</string> <key>SupportedValueList</key> <array> <dict> <key>OnlyTheseFrames</key> <string>AllFrames</string> </dict> <dict> <key>OnlyTheseFrames</key> <string>NonDroppableFrames</string> </dict> <dict> <key>OnlyTheseFrames</key> <string>IFrames</string> </dict> <dict> <key>OnlyTheseFrames</key> <string>KeyFrames</string> </dict> </array> </dict> <key>OutputPoolRequestedMinimumBufferCount</key> <dict/> <key>PixelBufferPool</key> <dict/> <key>PixelBufferPoolIsShared</key> <dict/> <key>PixelTransferProperties</key> <dict/> <key>PoolPixelBufferAttributes</key> <dict/> <key>PoolPixelBufferAttributesSeed</key> <dict/> <key>Priority</key> <dict/> <key>RealTime</key> <dict/> <key>SuggestedQualityOfServiceTiers</key> <dict/> <key>ThrottleForBackground</key> <dict/> <key>TransferFunction</key> <dict/> <key>UsingHardwareAcceleratedVideoDecoder</key> <dict/> <key>UsingSandboxedVideoDecoder</key> <dict/> <key>YCbCrMatrix</key> <dict/> </dict> </plist>
So it has a field mode of deinterlace but no actual deinterlace options and no deinterlacing takes place?

Re: Does VideoToolbox deinterlacing actually work on macOS or iOS?

Posted: 11 Jun 2017 16:15
by Jean-Baptiste Kempf
File a bugreport, then.

Re: Does VideoToolbox deinterlacing actually work on macOS or iOS?

Posted: 12 Jun 2017 16:12
by oviano
Done. I've also reported it to Apple as it's not clear where the fault lies.

It would be interesting to know if anyone else has got VT deinterlacing working though...