Log in

View Full Version : Putting some frames of a video to another


Heathcliff
14th June 2008, 19:38
Hello,
here is my problem.
I have 2 different masters of a movie. One is very good except some very bad frames i can't repair. The other is just average but has no broken frames.
I'd like to make a script to put change some frames of the first movie using the frames of the second, to have at the end the bad frames of my good masters replaced by the "average" of the second one.

Is it possible to do it ? (i have more than 1000 frames to replace & i work on uncompressed avi in 720*576)
I tried to check in the documentation but as i'm a very very bad scripter i don't even know how to start :helpful:

So if someone have an idea... it will be awsome :)

many thanks in advance !

Gavino
14th June 2008, 20:29
Check out stickboy's ReplaceFramesSimple function in his RemapFrames package on this page (http://avisynth.org/stickboy/).

You'll find lots of other useful stuff on that page, so bookmark it for future reference.

DarkT
14th June 2008, 21:36
Well, if it's just a few sequences, then I'd do something like

a=avisource("good.avi")
b=avisource("average.avi")

And then I'd make like

section1=b.trim(begin,end)
section2=b.trim(begin2,end2)

and then I'd go with

complete=a.trim(realbeginning,begin-1)+section1+a.trim(end+1,begin2-1)+section2+a.trim(end2+1,realending)

Well, something along those lines... If it's just 1 frame here, 2 frames there, well, I'd take out those frames (via save as png in AVSP) - and then re-insert them instead of those frame numbers... Dunno... depends I guess...

mikeytown2
15th June 2008, 03:21
I agree with Gavino's recommendation. Stickboy's RemapFrames package is the way to go.


highquality = AviSource("capA.avi")
lowquality = AviSource("capB.avi")

#process video
# Replaces frames 10..20, 25, and 30 from highquality with the
# corresponding frames from lowquality.
ReplaceFramesSimple(highquality, lowquality , mappings="[10 20] 25 30")



BTW, where did these 2 files come from?

Revgen
15th June 2008, 09:27
I also suggest you use Colourlike if the frames from once source differ from the other. It compares the color levels of one clip and matches it.

Heathcliff
15th June 2008, 20:35
many thanks to you all !
I tried replaceframessimple suggested by gavino on a small sample and it worked insanely well ! :)
now i just have to make the txt file with these hundreds & hundreds of broken frames :rolleyes:

mickeytown2, the first source comes from a 1" tape and the second one a crappy BVU. The cuts were different so i had to make the same cut on both masters and i tooked me hours & hours. I also had to remaster the 1" tape which also tooked me hours & hours... I have to say i CAN'T wait to finish this movie :p