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 > VirtualDub, VDubMod & AviDemux

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th September 2019, 22:13   #901  |  Link
albino
Registered User
 
Join Date: Jul 2019
Posts: 5
I've never seen an actual camera that records dupe frames, other than maybe the 23.976 -> 29.97 thing I mentioned before, but there you go! Learn something new every day I guess
albino is offline   Reply With Quote
Old 15th September 2019, 23:51   #902  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 698
Quote:
Originally Posted by nji View Post
If anything else fails ... try ffmpeg.
And indeed:
https://stackoverflow.com/questions/...plicate-frames

And it works!
But if the criterion to remove is content based:
How to distinguish dupes from non-motion?
My genius idea for that:
Having a close look at the audio stream (if present).
But: the audio is quite unimpressed at times with dupes.

The only possible solution seems for me a filter (like Remove Frames),
that combines both - contents comparison and frame number pattern, like:
"Remove duplicate frames that appear in most times (= "fuzzy logic") regulary."
This should do the job.
Quick idea: 2 or more consecutive dupes are non-motion
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 16th September 2019, 08:27   #903  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 47
Hi shekh.

Yes, a very quick idea indeed

I agree:
2 or more consecutive dupes will probably be non-motion.
Probably.
But most (?) non-motion will be only 1 dupe.
Probably.
==> That's no reliable criterion to distinguish non-motion from
"generated" dupes.

To distinguish them one probably has to have a look WHY these
dupes are generated.
As I'm the opposite of a prof, I don't know much about all that matter.
But as there is a "nearly" kind of regular pattern, I do assume
it has to do with the cameras' firmware, or with some strange intermediate
frame rate conversion.
Maybe the cameras' "natural" framerate doesn't match with the wanted
or the audio resolution. So they insert (more or less) regulary frames
to match it? Or something like that.

If you assume that kind of cause, the algorithm I proposed above
(combination of content comparision and "fuzzy" pattern)
should do the trick. Kind of "adaptive pattern" mode in jpsdr's filter.
It doesn't remove the non-motion dupes (as ffmpeg does).
And it doesn't "de-sync", when the inserted-frame-pattern shifts (as jpsdr's
Remove Frame does).

But maybe someone should look, if he has this effect in his (older)
movies too... (Surprise-surprise).
nji is offline   Reply With Quote
Old 16th September 2019, 17:28   #904  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 47
Having had a closer look on the matter, I'm suspicious
if the duplicate frames actually are simple added,
or if they stand for a kind of "dropped frame" the
camera hardware wasn't quick enough for, and so inserted
a duplicate to stay in sync.
(Maybe there is someone here who knows if that was done sometimes?)
I tried to estimate it by the motion (and a possible "jump" next
frame of a dupe), but I'm not sure.
If that should be the case then removing the dupes would be wrong
(Except at the simple pattern of a dupe every other frame).
An improvement in that case would still be possible
by replacing the duplicates by a "temporal mean" of it's neighbours.

In both cases (true dupe or compensation for dropped frame)
there remains the problem of identifying the dupe positions.

It can't be possible that the positions are arbitrarily.
So I had a closer look to that too.
And indeed, not for all duping movies, but for the majority I found
that the period p (dupe at last pos) of dupes is not constant but more complex.
It is n times p, then (p+1), then n times p again, then... etc.
I.e. the "real period" is n*p + (p+1).
Starting at an offset.

If (!) the task is to remove the frames this can't be removed by jpsdr's Remove Frame.
In ONE go.
But in (n+1) goes!
First go: offset, period: n*p + (p+1), frame at pos. p
Second go: offset, period: p - 1 + (n-1)*p + (p+1), frame at pos. (p-1)+p
(n+1) go: ...
Not very cool I admit.
And one has to find out the pattern, and if it holds until to the movie's end
by having a close look at the frames.
(I really hope not be completely wrong with all that ;-)

Last edited by nji; 16th September 2019 at 17:32.
nji is offline   Reply With Quote
Old 16th September 2019, 19:31   #905  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 698
nji

Maybe it won't hurt to post a sample in videohelp restoration subforum. Some people there do exactly that for decades, remove artifacts from old videos. You will likely get a great description how your video was made and plenty of ideas )
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 16th September 2019, 19:50   #906  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 47
Yes, I will do that.
https://forum.videohelp.com/threads/...ns#post2560347

Actually I already thought to myself that my question is too specific for this VD2 subforum.
Thanks for the ideas everyone!

Last edited by nji; 16th September 2019 at 20:30.
nji is offline   Reply With Quote
Old 18th September 2019, 20:48   #907  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 47
Devoloping Filters: SDK and tutorials

Is there an up-to-date reference for writing filters.

http://www.virtualdub.org/filtersdk.html

seems to be out-dated.

Thanks - Greetings.
nji is offline   Reply With Quote
Old 18th September 2019, 20:58   #908  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 840
That page does not seem outdated. SDK 1.1 is the latest as far as I know. The .chm help file in the ZIP does appear outdated, but still useful. Fortunately, the ZIP file includes a src directory with sample filters written for SDK 1.1.
videoh is offline   Reply With Quote
Old 18th September 2019, 21:33   #909  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 47
nji is offline   Reply With Quote
Old 18th September 2019, 21:34   #910  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 698
Quote:
Originally Posted by nji View Post
Is there an up-to-date reference for writing filters.

http://www.virtualdub.org/filtersdk.html

seems to be out-dated.

Thanks - Greetings.
You can find sdk 1.2 and some comments about my new added stuff here: https://sourceforge.net/p/vdfiltermod/wiki/sdk/

By most part the old sdk still works unless you need support for something very specific.

(sdk 1.2 is also old, just a bit newer than 1.1)
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 18th September 2019, 21:45   #911  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 840
Cool, Shekh, thanks. I was not aware you had done all that work. Bravo!
videoh is offline   Reply With Quote
Old Yesterday, 22:07   #912  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 47
Filter "Interpolate"

I recently had a closer look on the output of the interpolate filter.
(Scale frame rate by: 2, Interpolation mode: linear blending).

If would have expected that only the inserted frames are blended
(from their neighbour frames).
But it seems that ALL frames are "interpolated" (= have a "shadow").
The original frames are touched also.

How does this filter work?
And
Is there a VD filter that interpolates only the inserted frames?
nji 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 01:36.


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