Log in

View Full Version : Decimation help


jse12
28th November 2016, 18:11
Hello. I am trying to restore a video to 23.976 it is currently 59.940.

I have been using:

ConvertToYV12()
Selecteven()
Decimate()

This is encoding to 23.976 but the output is full of dupe frames, I have the same issue if I use Selectodd() I went through the frames 1 by 1 in media player classic, they follow this pattern

AABBBAABBBAABBBAABBBAABB

Which if I half ( what select even / select odd is doing ) I get

ABBABBABBABBABBABBABBABB

Then decimate() is removing every 5th frame so I end up with

ABBABABBBBABABBABABB

Which is full of dupe frames :( how can I correctly decimate this content? any help is appreciated. Thanks

jse

LemMotlow
28th November 2016, 18:20
Was this video originally 29.97 fps before you deinterlaced it?

jse12
28th November 2016, 18:22
I havent deinterlaced it, I believe yes it was orignally 29.97 but my PS4 is outputting at 59.94 and thats all my capture card will allow me to capture at

LemMotlow
28th November 2016, 18:45
You do realize that Decimate, removing every 5th frame, is also removing unique A frames at every 15th frame?

jse12
28th November 2016, 18:48
Yes unfortunatly :( As I say im unsure how to correctly deal with this kind of video, I was using selecteven() to get to 29.94 and decimate() to get to 23.97 but like I said the end result is messed up with dupe and missing frames :(

LemMotlow
28th November 2016, 19:05
And you don't have a better way to properly capture video that uses a pulldown scheme? If it's anime you'll likely be disappointed because the pulldown and duplicate pattern will often change during the video.

jse12
28th November 2016, 19:11
I can capture via a monitor capture mode in obs at 29.940 but then I get dupe and missing frames every 2000 frames or so and the quality is lower. I would like to get this 59.940 decimated correctly. The content isn't anime. It's a TV show

LemMotlow
28th November 2016, 19:53
You would want to keep 2 of every 5 frames. Forget SelectEven and Decimate. Try this:
SelectEvery(5,0,2)

That will select AB in every group of AABBB and get 24fps. No telling how it will play. Can't speak for what will happen to the audio. You could also try sRestore(frate=23.976) or sRestore(frate=24), but without a sample to try it with, don't know what you'll get. Can't say I've ever seen anyone capture 2:3 pulldown that way.

[EDIT]But the first example of repeated frames you gave is:
AABBBAABBBAABBBAABBBAABB

Looks to be short one 'B' at the end. Is that what the pattern looks like? If so, you'll have to work in groups of 23 frames:
SelectEvery(23,0,2,5,7,10,12,15,17,20,22)

Good luck.

johnmeyer
28th November 2016, 21:42
Without a sample of the video it is totally impossible to provide a solution. The script shown by the OP in #1 will almost certainly produce the wrong results, and I suspect all the other scripts shown so far will not do the job either.

If the OP can do a lossless cut of about 5-10 seconds of the original, preferably picking something that has a lot of motion, it should be easy to suggest a solution.

LemMotlow
28th November 2016, 21:51
Without a sample of the video it is totally impossible to provide a solution.So true. Can't continue to guess on this one. What a weird way to capture.

hello_hello
30th November 2016, 11:35
Maybe I'm missing something obvious, but I'm not sure why Decimate() would be removing every fifth frame as such. Shouldn't it be removing the duplicate frame from each group of five?

I ask, because when I tried to simulate the problem by converting a 23.976fps source to 59.940fps, the following appeared to output the original 23.976fps video. I didn't check a huge run of frames for problems, but it played smoothly enough.

Changefps(59.940)
SelectEven()
Decimate()

If the capture is 59.940fps progressive, it should also be fixable with TDecimate by specifying the required frame rate.
http://avisynth.nl/index.php/TIVTC
Once again I started with a 23.976fps source.

ChangeFPS(59.940)
TDecimate(mode=7, rate=23.976) # or try mode=2

Or TDecimate lets you choose the number of frames to remove from the specified cycle. In theory, this should work:

TDecimate(Mode=1, Cycle=5, CycleR=3)

If the pattern of repeated frames changes and the result isn't smooth, you could give it a larger cycle to work with or use mode 7 instead.

TDecimate(Mode=1, Cycle=25, CycleR=15)