Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th June 2004, 20:35   #21  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally posted by manono
You may or may not get noticeable stuttering during the 24fps parts, but if you do, it surely won't be because of missing frames, but because of the extra duplicate frames.
Ehm... I was thinking of dups as also being a missing frame, since the dup is where a different frame should've been.

Of course, better wording might have been a good idea...

np: Underworld - Pearl's Girl (Underworld 1992-2002)
Leak is offline   Reply With Quote
Old 15th June 2004, 20:36   #22  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally posted by neuron2
Maybe I'll add some extra functionality to it, who knows?
Well - you, perhaps? *ducks*

np: Underworld - Pearl's Girl (Underworld 1992-2002)
Leak is offline   Reply With Quote
Old 16th June 2004, 14:32   #23  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
I thought of an idea that may help us out of our dilemma.

The basic problem is that after decimation we are missing some unique frames from the input. We can't put them back without messing up audio. Or can we? What if we put them back as blends:

before:

A A A B B C D D D E E

normally C could disappear, but if so we render:

A B+C C+D E F

I believe this may be a solution for decimating these clips while retaining smoothness and audio sync. I'll perform some experiments and report back.
Guest is offline   Reply With Quote
Old 16th June 2004, 15:51   #24  |  Link
len0x
I'm afraid we've to stop
 
len0x's Avatar
 
Join Date: Mar 2003
Location: Amongst mad people
Posts: 5,400
Quote:
Originally posted by neuron2

I believe this may be a solution for decimating these clips while retaining smoothness and audio sync. I'll perform some experiments and report back.
Thats exactly what I was thinking
__________________
Gordian Knot Family:
Gordian Knot: website, download
Auto Gordian Knot: Website and download, tutorial, FAQ
len0x is offline   Reply With Quote
Old 16th June 2004, 17:23   #25  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
Quote:
Originally posted by len0x
Thats exactly what I was thinking
Hey, don't be shy! Speak up when you have thoughts.
Guest is offline   Reply With Quote
Old 16th June 2004, 17:55   #26  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,607
erhmmmmm..

dropping or blending an orphan frame? why this?

wouldn't it be much cleverer, delaying the video by, lets say up to 3 frames, until frames get dropped or blended? maybe sometime later in the video we have the chance getting some more duped frames that are compensating orphaned frames.

or maybe accept a slight AV async, until a scenechange occurs
(dropping frames directly before/after scenechanges is not noticeable, while dropping frames within a scene IS noticeable)
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 16th June 2004, 19:57   #27  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
In practice, it doesn't happen that way. And the av sync mismatch is not slight. But hey, go ahead and implement it for a test of concept if you really think it is viable.

The only thing that really would be cleverer in my view would be to insert blank audio whenever required to retain orphans. I don't know how random 33ms audio silences would sound and in any case I'm not motivated enough by the problem to go down that route. But adding the blend mode to FDecimate() is not too difficult.

Last edited by Guest; 16th June 2004 at 19:59.
Guest is offline   Reply With Quote
Old 17th June 2004, 03:21   #28  |  Link
Zep
Registered User
 
Join Date: Jul 2002
Posts: 587
Quote:
Originally posted by neuron2
In practice, it doesn't happen that way. And the av sync mismatch is not slight. But hey, go ahead and implement it for a test of concept if you really think it is viable.

The only thing that really would be cleverer in my view would be to insert blank audio whenever required to retain orphans. I don't know how random 33ms audio silences would sound and in any case I'm not motivated enough by the problem to go down that route. But adding the blend mode to FDecimate() is not too difficult.
grab either side of the 33ms gap and PULL the audio range
to center via an audio stretch with pitch save.

zep ducks...
Zep is offline   Reply With Quote
Old 17th June 2004, 10:44   #29  |  Link
len0x
I'm afraid we've to stop
 
len0x's Avatar
 
Join Date: Mar 2003
Location: Amongst mad people
Posts: 5,400
Quote:
Originally posted by neuron2
I don't know how random 33ms audio silences would sound
I can imagine it will sound awful...
__________________
Gordian Knot Family:
Gordian Knot: website, download
Auto Gordian Knot: Website and download, tutorial, FAQ
len0x is offline   Reply With Quote
Old 17th June 2004, 11:20   #30  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,607
for sure, I cannot implement this mzself, I just had some thoughts...

so, why is it not possible to accept a slight A/V async to achieve that only frames on scene changes (and not within a scene) are getting dropped? Most of the FIlms have very much cuts, so it should be okay...

I do not mean the 24 / 30 hybrid problem here. I think about weird patterns....
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 17th June 2004, 12:17   #31  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
I would prefer to post some praises about fdecimate... but alas, I found a strange thing about it, that hinders me in evaluating it for a specific case:

It seems that fdecimate is not playing nicely together with scripts that use AviSynth's conditional environment.

When I exchange SmartDecimate (within Restore24) with fdecimate, then the script goes totally goofy.
I discovered the following: when calling fdecimate(metrics=true), then

- the clip is still decimated to 23,976 fps (the docs say it won't decimate at all when metrics=true)

- much more serious: some variables in Restore24 will "freeze".

Restore24 uses a good amount of global variables. And at least one of them, initialized with a value of 1.0, will freeze at 0.999..., instead of getting updated on every frame. Probably even more variables are affected, I can't tell for now.

The script's flow is basically quite simple:

[clip /w blended fields] -> [bob] -> [conditional filtering] -> [clip /w dups] -> [decimation]

Obviously, decimation is the very last step.

Without fdecimate as decimator, everything is fine. When calling fdecimate(metric=true), the mentioned freeze of one or more global variables will occur, so that the blend replacement doesn't work any more at all.
Lastly, when simply calling fdecimate(), then the freeze of variables seems to NOT occur. But still, the decimation goes glorily wrong, then.


Donald, I know this is a pretty muddy bug report :| But I have no clue what really is going on here. Only thing I know - something IS going on.

Perhaps you have an idea where to look for the cause. I'll be happy to provide more information, if you tell me which.


Regards

Didée
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 17th June 2004 at 12:19.
Didée is offline   Reply With Quote
Old 17th June 2004, 13:10   #32  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
@Didee

That's really strange, especially the claim that it still decimates with metrics=true!

What happens if you save the output of the clip minus the final FDecimate() as an AVI and then apply FDecimate() to that. Is it the same?

Anyway, please PM me with the script and some instructions for recreating the issue and I'll look at it.

@scharfis_brain

I'm not saying your idea is without merit, but with the two clips I have there are lengthy scenes that drift terribly out of sync. So I don't think it is reliable enough to handle all instances but it may allow one to avoid some blends. But it would be a very difficult thing to implement and may well require two pass operation.

Last edited by Guest; 17th June 2004 at 13:12.
Guest is offline   Reply With Quote
Old 17th June 2004, 16:38   #33  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
intermediate report:

When first saving the de-blended 50fps clip to HD, and then feeding that to fdecimate, then the decimation is handled correctly. (Phew )

But even when doing it this way, setting metrics=true gives me a strange output. fdecimate then delivers a clip with 23.976fps, and 'correctly' reduced framecount.
But the actual series of frames is : new-dup-new-dup-new-dup-dup-new...



I'll provide you tomorrow with test material.


- Didée
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 17th June 2004, 22:07   #34  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
I know what's going on. I'll fix that in the next release, which will also add the singleton blend mode.

I forgot to make the fps and frame count settings conditional on the metrics setting.

I'd like to get the test materials anyway, to address the other problem you reported.
Guest is offline   Reply With Quote
Old 18th June 2004, 03:17   #35  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
Status report: Found some bugs that could explain the problems. Fixed them. YUY2 was causing memory overwrites.

I've completed the code that detects when a skip occurs and it is working well. Now I just need to add the frame blend code stolen from Decomb and then we'll know whether it was all worthwhile or not.

I'll do that tomorrow.

BTW, my skip detection code shows that I accumulate as many as 10-15 skips before a scene change in many cases. That would be a large desync and then I'd have to lop off 10-15 frames at the scene change. So it's a good idea in theory but not in practice.

Last edited by Guest; 18th June 2004 at 03:23.
Guest is offline   Reply With Quote
Old 18th June 2004, 05:52   #36  |  Link
Zep
Registered User
 
Join Date: Jul 2002
Posts: 587
Quote:
Originally posted by neuron2
Now I just need to add the frame blend code stolen from Decomb and then we'll know whether it was all worthwhile or not.
hehe


Quote:
[
I'll do that tomorrow.

BTW, my skip detection code shows that I accumulate as many as 10-15 skips before a scene change in many cases. That would be a large desync and then I'd have to lop off 10-15 frames at the scene change. So it's a good idea in theory but not in practice. [/B]
woah that many. Did you get a 15 from that clip where thay are walking
down the hall way for like 1 minute without a scene change?(just curious)
Zep is offline   Reply With Quote
Old 18th June 2004, 12:38   #37  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
Quote:
Originally posted by Zep
woah that many. Did you get a 15 from that clip where thay are walking down the hall way for like 1 minute without a scene change?(just curious)
There are 23 skips in that scene! Most of them are minor but a few are really obvious.
Guest is offline   Reply With Quote
Old 18th June 2004, 16:14   #38  |  Link
Zep
Registered User
 
Join Date: Jul 2002
Posts: 587
Quote:
Originally posted by neuron2
There are 23 skips in that scene! Most of them are minor but a few are really obvious.
i kinda figured there was a lot because that was the scene
i love to test on because lots of movement (the pillars)
makes for easy spotting of singletons and i saw plenty of them.
(I never counted how many though)

yes it is the singleton cuts that are really obvious in
that scene.
Zep is offline   Reply With Quote
Old 19th June 2004, 13:28   #39  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
Blend results are disappointing

I've completed my experiments with the blend idea. They are very disappointing. The skips are just as obvious if slightly attenuated. The improvement is nowhere near enough to justify itself.

So I just went ahead and fixed the existing version, resulting in version 1.0.1:

http://neuron2.net/fdecimate/fdecimate101.zip

For those wondering how FDecimate() differs from ChangeFPS(), it can preferentially deliver unique frames, avoiding duplicates where possible.

I don't see a fully acceptable solution to Zep's problem short of a coordinated adjustment of the audio.

@didee

I tried to run your restore24 scripts but I got an error that the script wasn't returning a video clip and I didn't have time to to track that down. Also, there was a syntax error on a levels call, so apparently this script had never run. Anyway, please try the fixed version and report back. Thank you.
Guest is offline   Reply With Quote
Old 19th June 2004, 17:26   #40  |  Link
Zep
Registered User
 
Join Date: Jul 2002
Posts: 587
Re: Blend results are disappointing

Quote:
Originally posted by neuron2

I don't see a fully acceptable solution to Zep's problem short of a coordinated adjustment of the audio.
darn. now what? more and more streams are like those.
Do you even want to try to adjust audio or is that too much
of a pain to get into?

i wish i had to a way to do the whole clip like i did in my tests
without doing it manually just to see how good it comes out on a
full encode.

Are there any free compilers that can do avisynth filter dev with?
I have some ideas but i can't ask you to keep messing with this.
It is time i get my hands dirty and i always wanted to get into
filter tests so now is a good as time as any

Last edited by Zep; 20th June 2004 at 05:26.
Zep is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.