Log in

View Full Version : Is it possible to force AviSynth to write a dropped frame?


FredThompson
26th May 2003, 11:32
I'm looking for help generating "dropped" frames. I suspect AviSynth cannot do this because it runs above the codec level. However, maybe there IS a way to generate frames which MotionPerfect will interpret as being damaged.

My source is DV though I can dump the stream to HuffYUV if that would help. I'm very fluent with scripted creation of text files so creating a huge AviSynth script to handle each frame by reference is not a challenge.

If this can be done, I'm more than willing to put together a complete how-to teaching how to recover from my mistake:

Didn't decomb an NTSC broadcast of a film. I deinterlaced and cleaned then realized what I'd done. Original is lost. So, idea is to throw out the 2 ugly frames from each set of 5 and replace them with a "dropped" frame then run MotionPerfect to fix the gaps.

AS
26th May 2003, 13:24
Since you are willing to dump it through huffyuv. Try this

Do your cleaning in the your script and add ConvertBackToYUY2() to the end of your script

Get the latest vdub 1.53, this adds the drop-fram support. Go into video frame rate control and under frame rate conversion, convert to your desired frame rate, select ok.

Use fast recompress with you desired codec.

Then you should end up with a huff that's at the frame rate you wanted.

Edit: oops, it seems I misunderstood your problem. Please ignore.

FredThompson
26th May 2003, 16:08
Yes, the challenge is not the frame rate, it is the creation of dropped frames.

The first post was a little thick. That was typed after the first email from MainConcept.

I just got more email. All we need is a way to force the frame number. Zero or partial-length frames is too risky/complicated.

If someone can show me a way to do this with AviSynth, we can have a method to repair progressive streams that should have been decombed. If you don't change the frame rate, MotionPerfect will rebuild only the frames that are missing or bad.

Since AviSynth scripts don't have full flow constructs, I'll use Rapid-Q basic to create a script-builder. It's easily available and this would allow people to see the logic if they need to build another version. It's available at http://www.basicguru.com/rapidq/

Valky
26th May 2003, 16:17
so basically adding the right amount of dropped frames could also correct every de-sync problems during capture? There is a new option in latest VD to correct this?

AS
26th May 2003, 16:28
Originally posted by Valky
There is a new option in latest VD to correct this?

There is an option to upsample the frame rate by inserting drop frames in vd, Go into video frame rate control and under frame rate conversion(it's not really a conversion, it just adds in the drop-frames)

Whether it will fix the de-sync is another thing

FredThompson
27th May 2003, 01:21
I think you're talking about something different than what I am. I'm talking about creating specific "dropped" frames as a way to force MotionPerfect to fill in a gap. I've just looked at VirtualDub and don't see what I think you're describing. You can change the frame rate, yes, but that's doesn't create new frames, it's changes a file header.

Are you sure VirtualDub will create frames?

vhelp
27th May 2003, 20:25
hi all.

@ fredthompson, and others..

can I ask a slightly off-topic question here??

Is there an app that will scan through your .AVI captured file(s)
and display the total number of frames that were DROPPED during
capturing ??

That is, if someone capture, and forgets to look at their frames
dropped inside the capture app, they would have no way of knowing
if they did have droppings.. and, then if they perform their IVTC,
and encounter problems, they (includes myself) would blaim decomb
or whatever IVTC filtering they used instead. I can't tell you
how many times I fumbled in their cross-fire.

Is their an app after the fact ??

Thanks for the help guys.
-vhelp

FredThompson
27th May 2003, 21:03
Dynapel has a free program called VideoScope that might do that. It only works with old-style AVIs, though. http://www.dynapel.com

VideoScope's scanning is part of MotionPerfect.

FredThompson
28th May 2003, 10:44
I realized earlier tonight that all I'm looking for is a way to create a frame with zero image data, essentially, just a frame header should be passed.

This seems like something AviSynth should certainly be able to do. It's already creating headers, just needs to be told the "frame" is done, advance to the next one.

Also, creating "dropped" frames in a controlled manner would allow using MotionPerfect to make incrementally changing slow-motion. Basically, you'd insert a numebr of these manufactured "dropped" frames between good frames. The number of frames inserted would slowly increase in a controlled manner. Then you run the result through MotionPerfect which creates content for those "dropped" frames. Since the difference between the good frames would be quite small, the created frames also have very little difference.

Incremental speed-up is easier. You create a slow-motion stream with MotionPerfect then selectively remove frames in an incremental fashion.

So, does anyone know how to create intentionally "dropped" frames?

WarpEnterprises
28th May 2003, 15:56
AviSynth outputs only valid AVI, you won't get dropped frames (without a hack of avisynth itself)

FredThompson
28th May 2003, 16:15
That's what I was thinking. The documentation doesn't show anything to force a header-only or advance the frame count without writing a frame. Shouldn't be too hard to modify the source such that there's new command to force the start of the next frame. Actually, would be best with an argument (default of 1) that defines the number of frames.

I lack the skill to do it.

I can make a script generator to insert "dropped" frames as described above for frame correction and programmed slow motion, though. Could also do one to take care of this with a totally uncompressed stream but that would get incredibly huge because it's also got to create an output stream.

Hoping someone will be intrigued enough to handle the AviSynth mod. I'll supply the rest.

I've also asked Dynapel for a way to signal a frame should be treated as dropped. Problem with that is it will be a lot more complex. Any specially formatted frame contents will require a lot more code than just advancing the frame count.

FredThompson
29th May 2003, 11:25
I think I've figured this out and it's fiendishly simple. The mistake was trying to corrupt files from inside the video ap. I'm starting a new thread in the general capturing area and posting the explanation there.