View Full Version : Problem with deinterlacing (TFF and BFF in source change)


alexVS
4th January 2022, 17:31
I'm trying to process video of hockey game.
Video is interlaced, so I do deinterlace with Yadif(order = 1, mode = 1)
to make double frame rate 59.94fps
The problem is that some parts of video are Top Field First and looks like some parts are Bottom FF).
Yadif(order = 1, mode = 1) - some smooth, other jerky
Yadif(order = 0, mode = 1) - other smooth, previous one jerky

Example:
https://drive.google.com/file/d/1geq-aFqlEiouJYsmzhCg2Mgs1WREWekb/view?usp=sharing

around 15 seconds in, there's a change from TTF to BFF
It happens in many parts of video
Is there a way to solve this problem?

My script:
f1="WJC Rus-Swe.mkv"
video = DSS2(f1,FPS=29.97)
audio = DirectShowSource(f1,fps=29.97,audio=true)
AudioDub(video, audio)

yadif(order = 1, mode = 1)
lanczosresize(1280,720)
sharpen(0.2)

ConvertToYV12()

poisondeathray
4th January 2022, 17:47
Looks like source filter issues . Directshow /DSS2, ffms2, lsmash all have various problems with that source. Probably buggy timestamps in the MKV

If you demux to ES and use LSMash (LWLibavVideoSource on the elementary stream), it's ok except for the first few frames (maybe from the way it was cut), and it's BFF after

Or works ok with DGSource in MKV container, but you have to use AssumeFPS(30000,1001), and it's TFF

alexVS
4th January 2022, 18:33
Looks like source filter issues . Directshow /DSS2, ffms2, lsmash all have various problems with that source. Probably buggy timestamps in the MKV

If you demux to ES and use LSMash (LWLibavVideoSource on the elementary stream), it's ok except for the first few frames (maybe from the way it was cut), and it's BFF after

Or works ok with DGSource in MKV container, but you have to use AssumeFPS(30000,1001), and it's TFF

Thanks for help :)
I dont know very well LSMash

I tried:
LoadPlugin("D:\Program files\AviSynth 2.5\plugins\LSMASHSource.dll")

## LWLibavVideoSource with default settings:
v = LWLibavVideoSource("WJC Rus-Swe_track1_und.h264", fpsnum=30000, fpsden=1001)
a = LWLibavAudioSource(source="WJC Rus-Swe_track2_eng.aac")
Audiodub(v, a)

AssumeBFF()
yadif(order = 0, mode = 1)
lanczosresize(1280,720)
sharpen(0.2)



and video twitches after Frame 908 (0:00:15.148)
What I'm doing wrong?

poisondeathray
4th January 2022, 18:48
works ok for me; maybe old lsmash version ?

L-SMASH-Works-20210811 x64
https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works/releases

If you seek non linearly (jump all over the place), it can mix up frames. Go back a few seconds and frame advance. Setting threads=1 can also help, but default LWLibavVideoSource works here

There are duplicates in the "slo motion" sequence, but it's not fwd/back jerky