Asd-g / yadifmod2

YadifMod2 = Yadif + YadifMod
GNU General Public License v2.0
12 stars 6 forks source link

Add 4:2:2 support, please #5

Closed AlbertOpen closed 3 years ago

AlbertOpen commented 3 years ago

At first, many thanks for yadifmod2 I used to do high quality deinterlacing on Intel and especially AMD videocards (nVIDIA's videocards has almost perfect hardware deinterlacer inside chip when unchecked Inverse Telecine in nVIDIA Control Panel on my own so don't need to use yadifmod2) - bad hardware deinterlacing well seen on frame-by-frame viewing of 01520-gamak.mkv (295 MB) https://disk.yandex.ru/i/z_adjc35RwQnfg to watch interlaced SAT programs directly with donateware SmartDVB http://www.smartdvb.net/tempsite/download.html (btw see instruction in HEVC_quasi_interlaced folder there) or records from SATs in MPC-HC with https://github.com/AviSynth/AviSynthPlus and external ffdshow raw video filter (it has working with 4:2:2 yadif inside but with much poor quality than yadofmod2) or https://github.com/CrendKing/avisynth_filter yadif.dll 1.7 by Fizick from yadif17.zip works with 4:2:2 but slowly and it's x86 only and brakes hardware acceleration; https://github.com/chikuzen/yadifmod2 cannot be used as a plugin for AviSynth even on 4:2:0 01520-gamak.mkv; Your yadifmod2 plays 4:2:0 F1.Round.06.Grand.Prix.de.Monaco.2019.Race.HDTV.1080iDGSplit.ts (313 MB) https://disk.yandex.ru/d/5NCBNVwWx9rWZQ well but when I try to play 4:2:2 Formula1.2019.Round06.Monaco.Race.Sat.Feed.1080i.H264.Multi.Language_fromMKVtsMuxerNotHDMVcompatible.ts (501 MB) https://disk.yandex.ru/i/X1nPqEAqIAZXoQ (it's strange but LAV Video Decoder doesn't activate its internal YADIF deinterlacer on several such files) I've got input clip must be a planar format (

Asd-g commented 3 years ago

4:2:2 format is supported.

I have no problem with Formula1.2019.Round06.Monaco.Race.Sat.Feed.1080i.H264.Multi.Language_fromMKVtsMuxerNotHDMVcompatible.ts

https://i.imgaa.com/2021/07/23/60fa7c433a3e8791123015.png

AlbertOpen commented 3 years ago

Thanks for reply. Obviously LWLibavVideoSource (btw how get audio track hearable with it?) has planar output so yadifmod2 works with but I need yadifmod2 working in graph during live translations from SATs so I can't use LWLibavVideoSource there (if I right - I'm not AviSynth professional). So I've found solution for 4:2:2 streams with ConvertToYV12() before yadifmod2 in script for both ffdshow raw video filter and avisynth_filter but colorshift issue present in each second frame or with ConvertToYUV444() workin well in avisynth_filter (with MPC Video Converter from MPC-BE Video Decoder in graph) and give terrible permanent colorshift issue with ffdshow raw video filter Btw my weak processor give stutter video while playing Formula1.2019.Round06.Monaco.Race.Sat.Feed.1080i.H264.Multi.Language_fromMKVtsMuxerNotHDMVcompatible.ts with yadifmod2(mode=1,opt=5,order=1) (I need maximum possible quality) so desirable avoid any color conversion so my request is being changed to "add support of non-planar inputs to yadifmod2, please"

Asd-g commented 3 years ago

The issue is not in yadifmod2. The issue is the filter you're using to open the file (source filter). Formula1.2019.Round06.Monaco.Race.Sat.Feed.1080i.H264.Multi.Language_fromMKVtsMuxerNotHDMVcompatible.ts is YUV422P10. This is a 10-bit planar format. LWLibavVideoSource correctly open it as is YUV422P10. The source filter you're using is failing to open the file and outputs garbage. I tried DirectShowSource that is similar to the one from https://github.com/CrendKing/avisynth_filter. It gives YUY2 that is not planar format. YUY2 is equivalent of YV16 (YUV422P8). Most likely the source filters you're using are giving YUY2 and this is wrong. You should report the issue to the filter author. Now if you want to use LWLibavVideoSource you can convert the video from 10-bit to 8-bit so yadifmod2 will work faster. Here how to get audio and convert to 8-bit:

v=lwlibavvideosource("Formula1.2019.Round06.Monaco.Race.Sat.Feed.1080i.H264.Multi.Language_fromMKVtsMuxerNotHDMVcompatible.ts").ConvertBits(8).yadifmod2(mode=1,opt=5,order=1)
a=lwlibavaudiosource("Formula1.2019.Round06.Monaco.Race.Sat.Feed.1080i.H264.Multi.Language_fromMKVtsMuxerNotHDMVcompatible.ts")
AudioDub(v,a)
AlbertOpen commented 3 years ago

Thanks for reply again. I guess ffdshow will not be changed at all - may be I simply couldn't find working combination of its settings, I'll try to write CrendKing in days. AudioDub(v,a) is working well enough.