Hi,
There are lots of encoding tools who could benefit from automatic reliable decombing (many will see quot;reliablequot; and quot;automaticquot; as an oxymoron,right? ).
Seems neuron2's opinion about an all-purpose video deinterlacer goes to TomsMoComp:
showthread.ph...357#post325357
showthread.ph...522#post325522
Tried it today, does a very good job.There are no tools around for automatic IVTC, I think.I've seen some other ideas around:
showthread.php?s=amp;threadid=54191
This is a tool that works with Telecide's (debug=true) mode by processing the output captured by DebugView, I haven't got it to work yet.In the mean time I found a better process than DebugView:
home/ivec/dbgproxy.html
This tool forwards Windows OutputDebugString to MS-DOS STDERR, which I can redirect to a file (on XP at least) using AVS2AVI and a XVID Null encode:
dbgproxy avs2avi MOVIE.AVS MOVIE.AVI -s codec.cfg 2gt; debug.txt
and then parse the Telecide output.
(no typo on the gt; syntax, using 2gt; redirects STDERR instead of STDOUT)
Well, back to the point:
I guess we could in theory do a XVID Null encode with and AVS script with just MPEG2Source and Telecide(debug=true) to get the metrics, and then make a strategy out of it to use as an override file on the real encodes.
A Null encode with just this filter would be relatively quick and save time on both passes as well as improving reliability.
Better yet, such process could be done automaticaly based on the metrics and so avoiding user analisys ( and deal with hard-telecined sources too, not like my primitive ParseD2V method based on FILM flags).Neuron2 also talked about the possibility of such a method once:
showthread.php?s=amp;threadid=52928
and I would like to hear his opinion again, although I know he has been very, very busy. Of course I'd like other opinions as well Best regards,
Bilu
I don't understand your specifications, since you didn't give any.
Are you trying to create a tool with this specification?
quot erform perfect decombing without any user interventionquot;.
If not, please clarify the specifications.
And BTW, forum rules proscribe you from asking for the best anything; thread title edited.
Thanks for editing the title
My idea is:
1) XVID Null encode with Telecide(debug=true) and DBGProxy, just to get the metrics
2) *Missing* A strategy to find out field order and if the stream is interlaced PAL, reversed field PAL, Telecined / Hard-Telecined (wouldn't matter any more since we wouldn't base our work on flags ), Mostly Film Hybrid or Mostly Video Hybrid.
I haven't looked if any parameter in Telecide has influence in the metrics, and what could be done in this case. But it would be nice to be able to use a strategy based on the metrics because we could in theory automate the process. I also didn't look yet at possible ways to use the override files like in the tool I mentioned on my first post.
3) Encode using the Telecide and Decimate override files?It's basically the same idea you mentioned on the quot;all purpose script neededquot; thread (last link on my first post)Do you think such a strategy is possible?
Best regards,
Bilu
Hi-
I'm not sure I understand fully, but this sounds fairly similar to what MultiDecimate does. You run a real fast quot;First Passquot; to get the metrics (I'm getting around 100fps with it, although I'd probably have to explain to you you how I can do that), and then you set up the 2 real passes using the Cycle Mode. The decimation there is determined by the metrics, and what kind of Cycle-Frame Removal you specify. Have you looked at MultiDecimate, bilu, to see if it does what you want?
@manono
Thanks to Tom Daniel ('manono') for suggesting this new decimation functionality.
I guess you know it well, don't you? It's partially what MultiDecimate does. I've tested it now for the first time using:
ConvertToYUY2(interlaced=true)
Telecide(post=false)
MultiDecimate(pass=1,quality=3)
Metrics are already saved to a file so I could skip the whole DBGProxy process.
This was the mfile.txt generated by first pass on a Telecined encode:
0 0.000000
1 0.688529
2 0.730384
3 0.896588
4 0.000000
5 0.741072
6 1.285882
7 1.167753
8 1.094568
9 0.000000
10 1.347239
11 1.387400
12 1.430105
13 1.715316
14 0.000000
15 1.434957
16 1.486446
17 1.716319
18 2.016002
19 0.000000
20 1.617898
21 1.833077
....
There are cyclic duplicates (0,4,9,14,19,...) so we know we can decimate here. This works as a duplicate detector, but says nothing about the field order (I think).
A command-line interface instead of a GUI is required to automate the second-pass process.
It would need a new mode: something like quot;Global Protect static scenesquot; mode, (i.e. that would only decimate if lower than a threshold and lower than the number of defined duplicates in a row).
This mode should be enhanced to deal with hybrid decimation when needed, i.e. that could recognize Telecined streams, look at the Video/Film ratio to choose the best method, and that could decimate Video parts on hybrids in the new way described by Neuron2 on his journal (it's a must).So what I'm saying is:
1) Generated metrics should help distinguish Field Order, Video and Film parts;
2) The process should depend entirely on script plugins and/or command-line tools, not GUIs;
3) Should be able to calculate a FILM cycle percentage to decide between mode=1 or mode=3 decimation strategies;
4) Should decimate Video parts in neuron2's new mode: I think it's hard to improve on that
This way we would have a nice automatic 2-pass hybrid decombing
I had a problem using MultiDecimate over the progressive Fox News clip that neuron2 has on his journal.
Loaded with DirectShowSource(quot;D:\fox30.aviquot;,29.97)
Using quot;Global: Protect static scenesquot; with a threshold=1.0 or 0.5 and a run length=2 I got a clip with listed FPS of 9.396 fps ( on Zoom Player ). And that's strange because it only detected 3 duplicates at the end of the clip Do you think this is a realistic objective? I'm getting around 100fps with it, although I'd probably have to explain to you you how I can do that
A Null encode with only the needed MultiDecimate and Mpeg2source filters plus a fast IDCT? Or other stuff? Best regards,
Bilu
Another typical application is removing 3 out of 4 frames for clips that were rendered at 120fps to properly present hybrids of film and video.
Haven't tried this method yet, is it reliable?I have also looked more seriously at Decombs override options (using 4.1b4).
A process could be:
1) Use MultiDecimate 1st pass to get metrics;
2) Parse the file for duplicate framenumbers and post them into another file;
3) Check the framenumber differences between duplicates and save them to a file;
4) Check how many of these differences are 5's and make an hybrid decombing decision based on it;
5) Generate override file with the quot;vquot; and quot;fquot; flags;
6) Encode Bilu
Hi bilu-
I guess you know it well, don't you?
MultiDecimate is a godsend for encoding silent films with weird cycles. Any of you guys out there encoding silents, jump on it. I haven't decided for myself yet just how useful it'll be for encoding hybrid material, as I haven't seen any recently. There may be problems with keeping the audio in synch.
A Null encode with only the needed MultiDecimate and Mpeg2source filters plus a fast IDCT? Or other stuff?
I just tried XviD's Null Mode for the first time, and it works well. Thanks for the tip. And I also crop pretty heavily into the video to make it run faster, since it's just finding the metrics. And if you don't at least crop the black bars away, it'll lower the metrics significantly.
Haven't tried this method yet, is it reliable?
If you're asking me, I don't have any anime raws with which to test, but I don't see why it wouldn't work well. The anime fansubbers should be experimenting with it also.
The rest of what you're asking is for neuron2 to answer, but:
This way we would have a nice automatic 2-pass hybrid decombing
I think you must be dreaming.
Originally posted by manono
This way we would have a nice automatic 2-pass hybrid decombing
I think you must be dreaming.
No, I think it's feasible.
I've looked at ivtc-tut.htm, sections quot AL TO NTSCquot; and quot;BAD TELECINESquot;. It seemed to me that sometimes you could get Telecine patterns different from 5.
quot;Check the framenumber differences between duplicates and save them to a filequot; seems a nice strategy here. We could avoid decimating the next duplicate when difference=1, to protect static scenes. We could also know which is the most used difference pattern on the clip and use it for decimation.
Example: 55 differences of 5, 20 differences of 3.
We would choose 5 for decimate.
I don't know if there are any streams around with patterns using more than one duplicate in a row. I'd like opinions on that.
No, I think it's feasible.
Am I thinking correctly? What would you add?
Best regards,
Bilu
Hi-
It seemed to me that sometimes you could get Telecine patterns different from 5.
Sure. Quite a few PAL to NTSC DVDs are converted from 25fps, and not slowed first to 24fps before telecining, and you have to Decimate(6) to get them to play smoothly. One common framerate for silent films is 20fps, and you Decimate(3). And for silent films in particular, they can be on the DVD as anything from 15 to 25 original fps.
I don't know if there are any streams around with patterns using more than one duplicate in a row.
They're rare in my experience, but not unheard of. I saw one just today, as a matter of fact. Every so often there was a quot;mini-cyclequot; of 4, with 2 original frames followed by 2 duplicates of the second frame. And of course anime is frequently drawn as 8 or 12fps and has multiple duplicates in a row.
Originally posted by manono
They're rare in my experience, but not unheard of. I saw one just today, as a matter of fact. Every so often there was a quot;mini-cyclequot; of 4, with 2 original frames followed by 2 duplicates of the second frame.
Was it anime, silent film, or a movie?
Bilu
@manono
I maybe killing my own thread by posting off-topic, but I have a doubt and maybe you can help me:
I've been testing hybrid decombing modes over completely film or completely video streams because I have no hybrid movies. So I grab every weird sample I can ( haven't grabbed the chest torture clip that neuron2 posted on the Uncomb thread though )
I've tested with this one posted here:
showthread.ph...687#post325687
using MultiDecimate(pass=1) and noticed that duplicates aren't 0.00000 in the metrics, but something between 0 and 1 even using post=false.
Do you think it is safe to assume that metrics from imperfect duplicates with blended fields like these will allways be less than one? Better to use TomsMoComp over the others?
Thanks in advance,
Bilu
@bilu
Mr. Graft is still hosting the Star Trek Challenge vob which is a standard hybrid clip, but hard to deal with because of the rapid pan.
showthread.php?threadid=43362
You can have a look at it if you want an example of a hybrid source. It is a bit short though.
@MrBunny
Thanks
Hi bilu-
Was it anime, silent film, or a movie?
It was both a silent film and a movie. Outside of anime, though, I think I've seen that happen only half a dozen times or so, and always with silents with large and complicated cycles.
Do you think it is safe to assume that metrics from imperfect duplicates with blended fields like these will allways be less than one?
I know it's not safe to assume that. They can be frequently over 1. I've seen quite a few DVDs that I think were mastered from laserdisc, and the duplicate frames are often different enough from the frame before them to give a metric larger than 1. A lot of the BBC TV shows converted to NTSC DVD were mastered from videotape or some such garbage and show the same thing.
Manono,
Do you think duplicate metrics range should be about the same for an entire movie?
I ask this because I made a test over Swan's snip.avi clip
(showthread.ph...687#post325687)
with a batch file that has int(metric) as parameter.
So if I run quot;do.bat 1quot; it will select every frame with int(metric)=1, output framenumber differences to a file and then count the differences.
The results is more clear than the explanation, I think.
do.bat 0
========
1 2
2 5
3 4
4 1
5 62
6 0
7 0
8 0
9 0
10 4
11 0
12 0
13 0
14 0
15 0
This shows that there were 62 frames with int(metric)=0 with a difference of five frames to the next frame within the same int(metric).
do.bat 1
========
1 28
2 8
3 6
4 3
5 6
6 2
7 1
8 2
9 0
10 0
11 0
12 0
13 0
14 1
15 0
do.bat 2
========
1 43
2 19
3 11
4 6
5 2
6 0
7 2
8 2
9 1
10 0
11 0
12 2
13 2
14 0
15 0
do.bat 3
========
1 38
2 10
3 5
4 7
5 1
6 2
7 1
8 3
9 4
10 1
11 0
12 1
13 0
14 1
15 0
So if:
- lower thresholds mean better probability to be a duplicate;
- difference=1 means consecutive frames within the same metric range, probably not combed parts;
Then maybe the probable cycle is 5, because it's the most used difference in lower thresholds, and difference=1 shouldn't be accounted.
And if you calculate
(nr of duplicates on cycle)/(framecount/cycle)
62 / (379/5) = 62/75,8 = 0,817
it gives you 0,817 in this case, which means this duplicate pattern at the 5th frame is used in 81,7% of the stream. This would make us choose Decimate (mode=3) as we recognized it as a mostly film hybrid.What do you think?
Best regards,
Bilu
Hi-
What do you think?
Sorry bilu, but I didn't understand any of it. I just use MultiDecimate for decimating silent films where the cycles can be large and complex (I've seen cycles of over 200 frames). It isn't and can't be perfect, because sometimes the true original frames have metrics lower than the duplicate frames, if the source material isn't so good. This can occur when there isn't much or isn't any movement in the original frame, or when the movement is off in the distance. This can also occur if the duplicate is a blend of 2 frames and has a larger metric than some of the true original frames in the designated cycle. This can be fixed by adjusting the metrics manually, but can get pretty time consuming.
I would like to try it out with some hybrid material one of these days. I'll probably have some anime to test soon. But it may not be too useful for that unless we have the option to quot;Remove no more than x frames out of every y framesquot;, in order to keep the duplicates meant to be kept, from being removed. And I'm still not sure how to maintain audio synch, unless you keep the cycle low enough.
It isn't and can't be perfect, because sometimes the true original frames have metrics lower than the duplicate frames, if the source material isn't so good. This can occur when there isn't much or isn't any movement in the original frame, or when the movement is off in the distance. This can also occur if the duplicate is a blend of 2 frames and has a larger metric than some of the true original frames in the designated cycle.
Yes, I know now
I've uploaded the D2V file, the MultiDecimate metrics file, my batch file for counting duplicates (XP only, same dir as mfile.txt) and the results from running the batch for int(metrics)=0, 1 and 2.
bruno_henriques/tngsample/
The clip is TNGsample.vob from the quot;Star Trek hybrid challengequot; thread.
I can see now that metrics are not reliable for detecting duplicates, at least for now Bilu
This may have potential:
Quantified Motion Filter: adaptive motion filter for Avisynth
showthread.php?s=amp;threadid=56051
Having the possibility to separate low-motion from the rest could enable duplicate search for thresholds 0.00000 and between 0 and 1 (maybe 2?) on the medium/high motion metrics file.
For low-motion metrics we would only search for 0.00000.
If we don't find enough 0.00000 in the low-motion metrics we would have to stick to the result from the high/medium motion metrics file.
Besides cropping black bars this could be a precision enhancer too.
I'll have to check that.Bilu
Conditional filter support would be a great thing for decomb i agree. If it (in some version) was able to simply return the combing detections it makes it would be even more flexible.
However I don't think it's the time right now, as Donald is currently working on these algorithms. Personally I would rather see a stabilized version with YV12 support.
There is one small (development) problem. For decomb to become conditional, it would have to be able to do the decision without having ant knowledge of any prior decisions. I son't know if decomb still stores previous decisions for pattern recognizion, of if it is completely beyond that, and each frame is considered separate. |