Log in

View Full Version : Deinterlacing PAL 25i VFR to 50p CFR?


PTRACER
1st August 2018, 14:44
I've spent hours/days/weeks hunting for help on this, but the answers I get are a little confusing for me.

Mediainfo reports my clip to be running at 31.239 FPS, but its Original Framerate is 25fps (PAL).

If I try to deinterlace with QTGMC via VirtualDub, I get a wild video littered with stutters, empty frames, incorrect field orders and occasional short sections of perfectly smooth video. Therefore I'm not sure if this video counts as simply VFR, or a hybrid video.

What's the best approach to get a smooth, 50fps, deinterlaced output from this source? :)

------

Note: Video is in an MKV container, but it contains multiple streams, so I've demuxed it to .TS

FranceBB
1st August 2018, 15:07
Therefore I'm not sure if this video counts as simply VFR, or a hybrid video.

We don't know it too unless you upload a sample.
And what's your script?
It's weird that QTGMT got it wrong.
Besides, if it's a .ts and it went on air in a PAL region, I don't think it's VFR. The "oddest" thing you can find in PAL is a truly interlaced content (25i) and a progressive part flagged as interlaced (25p). If you wanna "bob" the truly interlaced part keeping both fields, you'll get duplicated frames on the 25p part anyway, so you would have to manually decimate the progressive parts and blend them to 50fps to get it slightly more smooth.

My advice?
Deinterlace to 25fps progressive.
Try with something like:

tdeint(mode=2, order=-1, field=-1, mthreshL=6, mthreshC=6, map=0, type=2, debug=false, mtnmode=1, sharp=true, cthresh=6, blockx=16, blocky=16, chroma=true, MI=64, tryWeave=true, link=1, denoise=true, slow=2)

PTRACER
1st August 2018, 17:05
What's the best way of providing a sample without re-encoding and therefore destroying the original clip?

I tried the tdeint script, the FR was still 31.239 when I loaded it into VDub.

poisondeathray
1st August 2018, 17:24
What's the best way of providing a sample without re-encoding and therefore destroying the original clip?


Since the original is in a MKV container, probably mkvtoolnix. There is a splitting option in the output tab

FranceBB
1st August 2018, 17:29
Since it's an mkv, you can use the split function in mkvmerge https://mkvtoolnix.download/doc/mkvmerge.html#mkvmerge.description.split

31.239fps is a weird framerate.
What's the framerate before you deinterlace?
Which indexing are you using? (ffms2, libav ecc)


EDIT: @poisondeathray... Oh, you beat me on time while I was still typing xD

Ghitulescu
2nd August 2018, 15:36
25i VFR is rather contradicting in terms.
To my knowledge, only screen caps, some surveillance cameras and kids chinese cameras have VFR, all others are CFR (some fps are also weird in some cases - I met a camera providing 29.918 fps).

What is your source?

PTRACER
6th August 2018, 07:04
Here's a 1 minute section of it. It's from a TV broadcast, but I didn't encode it and I have a feeling the person who did messed about with it somehow, maybe to aid compression. I just want to be able to watch it on my PC in 50p without deinterlace lines: https://mega.nz/#!1V5nWTLK!pDG0O5Tw-Pq6rORVTXUZPaah9kvfqLn34sbvRVxXCMs

You'll see that, in VLC, if you deinterlace to say, Linear or Yadif (2x), it'll be smooth, but every other frame shifts a pixel up/down (mostly noticeable on the solid text at the bottom). However, VLC is obviously taking VFR into account, which VDub cannot do.

I can use a program called VidCoder, which will handle VFR and converts the clip to CFR and 'DeCombs' using EEDI2 Bob, but the output isn't quite as smooth as in VLC, and still the video bounces up and down every alternate frame as above.

Have a play and see what you think!

Note: I meant 50i, not 25i. Of course I meant it's 25fps interlaced and 50fps if deinterlaced, but I want to retain the full framerate.

FranceBB
6th August 2018, 09:11
Libav deinterlace just deinterlaced not so badly to ~25fps, but I did see objects jumping back and forth using Bob() - out of curiosity - QTGMC with the fast preset and tdeint as well. Mode=2 of tdeint tried to interpolate fields in a slightly smarter way, but it couldn't quite get the right ones.

I tried with TFM(PP=6, slow=1, mChroma=true, chroma=true, mode=5) and although objects are no longer jumping back and forth, it outputs duplicated frames.

Probably, QTGMC properly tweaked is able to output it correctly, but when I set it and launched my encoding test I got 0.02fps, so I stopped it.

This is what I got from Libav deinterlace (default parameters, linear blending mode) and TFM: https://we.tl/GZlmzmKNBq

I gotta go back to work, but I'll try to play a bit with QTGMC later on if I have time to wait for it to render a test. ;)

PTRACER
6th August 2018, 10:00
Libav deinterlace just deinterlaced not so badly to ~25fps, but I did see objects jumping back and forth using Bob() - out of curiosity - QTGMC with the fast preset and tdeint as well. Mode=2 of tdeint tried to interpolate fields in a slightly smarter way, but it couldn't quite get the right ones.

I tried with TFM(PP=6, slow=1, mChroma=true, chroma=true, mode=5) and although objects are no longer jumping back and forth, it outputs duplicated frames.

Probably, QTGMC properly tweaked is able to output it correctly, but when I set it and launched my encoding test I got 0.02fps, so I stopped it.

This is what I got from Libav deinterlace (default parameters, linear blending mode) and TFM: https://we.tl/GZlmzmKNBq

I gotta go back to work, but I'll try to play a bit with QTGMC later on if I have time to wait for it to render a test. ;)

Thank you so much for trying!!

Libav seems one way to go, if it can output the full 50fps. The TFM output seems to read 28.804fps in Vdub, hence the jumping...

Look forward to seeing your results with QTGMC!

Frank62
6th August 2018, 10:45
I just opened the mkv with VirtualDub 2 (FilterMod). It plays smooth with doubled interlaced frames at 50fps. So I frameserved, used just

avisource("served")
selectevery(2,0)

and the result was a clean 25i clip, that may be deinterlaced with QTGMC. The interlace structure, though, looks a bit weird, the clip might have been resized while interlaced, so this seems the bigger problem to me.

There are short scenes in slow-motion, I don't know if maybe these caused VFR-detection?

hello_hello
6th August 2018, 11:09
The timecodes are weird. There's lots of 20ms frames....or fields... but every so often there's a 40ms field. I'm not sure if there's a constant pattern (I didn't look that hard), but maybe there's lots of fields missing.

For one of the decoding methods I tried (Lsmash, I think), for some sections Info() claimed it was alternating between top field first & bottom field first quite a bit. I think I'd give up on that one.

If they're fields, what should the duration be? It'd be 20ms for a progressive 50fps frame, but is t it the same for 50 fields per second?

Timecodes:

# timestamp format v2
0
40
60
80
120
140
160
200
220
240
280
300
320
360
380
400
440
460
480
520
540
560
600
640
680
720
760
800
840
880
920
960
1000

PTRACER
6th August 2018, 13:05
Passed the video through VidCoder and solved the 'problem' with the VFR. This converted it to CFR somehow:
https://mega.nz/#!BRAxmYrS!sSgTpeBRbh0rVrLyq2k3VrX5fb2kQcG7RiAi6eFGv_0

Try deinterlacing this though....the text in particular bounces wildly on every alternate frame. This isn't obvious in moving footage - are there any deinterlace scripts that can fix this without disturbing overall quality?

Temporal smoothing on its strongest setting in QTGMC (TR2=3) fixes the worst of it, but the clip loses a lot of detail. It's as you say Frank, I think the clip was resized while interlaced (maybe by the TV company).

Thanks for your efforts so far guys!

PTRACER
8th August 2018, 13:26
Are there any potential fixes for this?


https://image.ibb.co/mdq4GK/Webp_net_gifmaker.gif