View Full Version : Yadif produce duplicates and skips
rhaz
5th October 2017, 17:02
I have this questionable quality video clip (http://www49.zippyshare.com/v/26XLxnpd/file.html), when I apply yadif I get a very clunky result.
DGDecode_mpeg2source("sample.d2v")
Yadifmod2(order=1)
I tried various options like order=0 or mode=1-2, but it gets even worse.
manono
5th October 2017, 22:11
You can thank your source for that. Maybe that herky-jerky effect is intended. You know, the chaos of the city. Or maybe it's just incompetence. It has a lot of duplicate frames/fields as well as missing frames/fields. Plus, it's field-blended so you probably should follow your bobber with SRestore.
rhaz
6th October 2017, 12:31
But srestore ends up in even more skips? And srestore wont deinterlace and wont get rid of duplicates. From what I understand, the source is 25fps and already has skips, you add srestore it adds more skips because framerate becomes even lower than 25fps.
Okay so, if source already has skips, leave it be, but how do you not add more skips, but just deinterlace and remove duplicates?
Sharc
6th October 2017, 13:06
But srestore ends up in even more skips? And srestore wont deinterlace and wont get rid of duplicates. From what I understand, the source is 25fps and already has skips, you add srestore it adds more skips because framerate becomes even lower than 25fps.
Okay so, if source already has skips, leave it be, but how do you not add more skips, but just deinterlace and remove duplicates?
As manono wrote you have to bob-deinterlace before applying Srestore. Still, your source is messy, I think, but you can try something like:
yadifmod2(mode=1,order=1) #bob-deinterlace
Srestore(frate=30.0/1.000).tdecimate() #removes blends and duplicates
assumefps(25) #24 to 25 speedup if needed
No duplicates but jerky. Maybe someone has a better idea.
rhaz
6th October 2017, 19:37
@Sharc what you mean by jerky? Did it add extra flaws, more skipping frames (because now fps became lower than 25)? Because I tried your method and it looks good, way better than source.
manono
6th October 2017, 19:48
And srestore wont deinterlace
Whatever bobber you use before it, already deinterlaced it, YadifMod2 in your case. It's a 2-step process, bob followed by Srestore.
From what I understand, the source is 25fps...
If that's true (I don't know the source), then your script should be written:
yadifmod2() #bob-deinterlace
Srestore(frate=25)
It's unusual for a PAL source to be field-blended with 25fps the intended output framerate.
If you want to remove all the dupe frames, then you have to use MultiDecimate or DeDup. Doing that, though, will lower the framerate significantly. Or you could try interpolating the dupe frames using FillDrops (https://forum.doom9.org/showthread.php?t=104294).
manolito
6th October 2017, 20:39
The original FillDrops by MugFunky is a little old...
A current replacement is "InterpolateDoubles" by MysteryX which is part of the latest FrameRateConverter script:
https://github.com/mysteryx93/FrameRateConverter/releases/tag/v1.2
Cheers
manolito
wonkey_monkey
6th October 2017, 21:23
Whatever the original video was, it wasn't 25fps. That's just what the clip is now.
Sharc
6th October 2017, 23:31
@Sharc what you mean by jerky? Did it add extra flaws, more skipping frames (because now fps became lower than 25)? Because I tried your method and it looks good, way better than source.
Jerky at the beginning only (traffic scene) due to missing frames in the source. The rest is fine, as you noticed :)
rhaz
7th October 2017, 11:03
Jerky at the beginning only (traffic scene) due to missing frames in the source. The rest is fine, as you noticed :)
Anyway, I applied that to full video and I noticed it leaves dupe frame on people faces exactly where srestore was applied to remove blends on motion. I tried with frate=30.0/1.000 (24fps) and frate=30.0/1.001 (23.976).
Also I tried that FrameRateConverter and ended up with 100fps. Don't know how to use it properly and it's real slow on an i7. Don't know if it's worth it just to remove duplicates, I hope there's a tdecimate solution instead.
StainlessS
7th October 2017, 19:56
If you want to remove all the dupe frames, then you have to use MultiDecimate or DeDup. Doing that, though, will lower the framerate significantly. Or you could try interpolating the dupe frames using FillDrops (https://forum.doom9.org/showthread.php?t=104294).
Multidecimate is pretty damn good, but suffers in that it only supports YUY2 (I think, well, pretty sure), MDec2 supports all 2.6 colorspaces.
NOTE, numbers have to work out exactly, maybe I should have added a little bit of flexibility there, but if dropping 1 in 5 from 29.97 to 23.976 then rate=24.0 would not work, it would expect 29.97 * 4 / 5, ie 23.976.
MDec2:- https://forum.doom9.org/showthread.php?t=168397&highlight=mdec2
Thread where user supplied in above case Rate=24.0 when should have supplied Rate=23.976:- https://forum.doom9.org/showthread.php?t=174772&highlight=mdec2
In other words, if you drop 1 in 5 from 29.97, result is not 24.0 FPS.
In such case use eg
Audiorate=Audiorate()
AssumeFPS(30.0,sync_audio=true)
#Mdec2(Rate=24.0,create=true) # first pass
Mdec2(Rate=24.0,create=false) # second pass
ReSampleAudio(Audiorate) # out = 24FPS, audio sample rate = original )
EDIT: Args are a bit different to Multidecimate, the source for Multidecimate was never published, MDec2 only supplies the metrics, Mutidecimate.exe and PrrocessMD.exe supply the decimating decisions (from original MD zip), MDec2 decimates based on those decisions.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.