Log in

View Full Version : Telecide, duplicate first frame even when Trim()ed?


jstelly
24th March 2005, 01:07
I've got a video clip and I have several Avisynth scripts that refer to it to split it up into 300 frame clips:

s1.avs

loadplugin("DGDecode.dll")
loadplugin("Decomb521.dll")

mpeg2source("source.d2v")
Telecide(guide=1,order=1,hints=true)
Decimate(cycle=5,mode=3)
Trim(0, 299)


s2.avs

loadplugin("DGDecode.dll")
loadplugin("Decomb521.dll")

mpeg2source("source.d2v")
Telecide(guide=1,order=1,hints=true)
Decimate(cycle=5,mode=3)
Trim(300, 599)


I take those two scripts, encode both of them to separate AVI files with GraphEdit, then merge them.

Telecide duplicates the first frame, right, because there's no previous frame to compare it to? Makes sense. I would expect the first clip to have the duplicate of the first frame, but I would expect the rest of the clips to use the last frame from the previous clip (299, 599, 899).

Is there a way in Avisynth to drop the first frame from these clips leaving me with no duplicates? If not, would it be possible to add an option to Telecide() to do this? Neuron2 or anyone else familiar with the code, can you point me towards what functions I need to look at to get started or give me something to get me started?

Thanks in advance.

Guest
24th March 2005, 01:45
Telecide neither compares nor duplicates frames. I can't answer until you clarify things.

jstelly
24th March 2005, 02:10
I saw this on your page:

Note that the filter must buffer frames to work properly. Therefore, stepping backwards on the time line will produce undefined results. Also, due to the technicalities of the buffering, the last frame is lost, and the first frame is repeated as well as deinterlaced by throwing away its bottom field. All frames after the first two will be recreated progressive frames.

I know it's talking about the Telecide VirtualDub filter and not the AviSynth filter, but I assumed it applied to Telecide for AviSynth also, I guess that's not correct?

I just looked through 10 of my segments and I found 2 where the first frame wasn't duplicated. Maybe this is Decimate() not removing the duplicate?

The problem looks like this. Below are 4 frames, and you can see that frames 900 and 901 are identical:

899 (the last frame in a clip)
900 (the first frame in the next clip)
901 (the second frame in the next clip)
902 (the third)

http://js.ofasoft.com/vid/899.jpg

http://js.ofasoft.com/vid/900.jpg

http://js.ofasoft.com/vid/901.jpg

http://js.ofasoft.com/vid/902.jpg

Guest
24th March 2005, 14:23
You're right, that statement about VirtualDub Telecide() does not apply to Avisynth Telecide().

I assume you are doing straight 3:2 IVTC.

First apply just Telecide() and step through the resulting frames. Do you get one duplicate every five frames? Specifically, in the area where you get a duplicate on final output, is that the case?

Then apply Decimate() and see if it chooses the right frames to remove.

This should allow you to determine the source of the problem. Then we can discuss solutions.

If you care to upload a small clip to my server I can have a look at it for you.

jstelly
24th March 2005, 17:21
With just Telecide I do get a duplicate every 5 frames (with an exception mentioned below). When I change the Decimate call to mode=1 this problem goes away but every once in a while it misses a duplicate that isn't at the start of a clip.

The clip that I'm encoding is like a collage of trailers from a DVD. When I do a show=true on Decimate, the video goes from frame 0 to about frame 500 locking on multiples of 5 for decimation, but on some of the splices they do, it only has 3 frames between the duplicates, then it's every 5 frames until they splice again where the duplicate is only 2 frames after the previous one. Is this a normal scenario for movies or is this something odd because it's a preview clip?

Thanks for your help. The reason I'm doing only 300 frames per segment right now is to test my merging code. When I finally start using this stuff for real I'll bump that number up to probably 5000 frames per segment.

Guest
24th March 2005, 17:34
I have nothing to say about the "normal scenario for movies", other than that the telecine phase can change at edits. That leaves me wondering if you have any remaining questions about Telecide and Decimate that haven't been answered.

jstelly
24th March 2005, 17:45
Originally posted by neuron2
That leaves me wondering if you have any remaining questions about Telecide and Decimate that haven't been answered.

I'm still very new to all of this, so I'm just starting to figure things out. I have many questions but I'm sure I can find answers for a lot of them by searching existing posts.

Thanks again for your help.

Guest
24th March 2005, 18:15
OK. If you run into any cases where the behavior is not as you expect, or which you cannot account for, feel free to ask and I'll try to help us understand it and fix things if required.