PDA

View Full Version : Replace dropped frames by mixing two adjecent frames?


ernstblaauw
22nd November 2003, 14:34
On holiday, I made a video with a couple of friends. The camera doesn't have a DV-port (it has one, but it doesn't response :-( ), so I captured it analogue.
After processing the whole film in Premiere, I found out that some captured AVI's have some dropped frames, so sometimes there are two identical frames. When I'm looking at that movie, the movie stutters. (Because the second frame is replacing another frame)
Is it possible to replace the second frame by a frame which is just made by "interpolating" the two adjecent frames? I think the stuttering will disappear.
I never heard about such a program, but maybe someone here, on this forum, knows such a program.

erratic
22nd November 2003, 14:40
DynaPel MotionPerfect (http://www.dynapel.com/com/private/mp_overview.htm)

- Analysis of the internal components of an AVI video file to display dropped frames and existing gaps in the video
- Filling gaps in video by insertion of new interpolated frames

If there's a way to accomplish this with Avisynth or Virtualdub, I'd like to hear about it.

scharfis_brain
22nd November 2003, 14:44
this task is harder than you maight think, because DV is interlaced , an thus a drop represents two movement states lost and replaced by the last two movement states.


original
----->time
.A B C D E top field
a b c d e bottom field

dropped frame

----->time
.A B B D E top field
a b b d e bottom field
. ^
. jerk

John2002
22nd November 2003, 20:35
It would be much easier to recapture the video with a setting that's easier on the computer to avoid the dropped frames. However, you could use VirtualDub to save out the whole video clip to an uncompressed file. Then save out a brief clip (like 1 second) that includes the dropped frames. Use TMPGEnc to save out all the frames to image files, then an image editting program to combine the two frames before and after the drop. Combine the two images as layers and make the top image 50% transparent and save this image to replace the frame image where the drop occured. Use TMPGEnc to reassemble the images back to an uncompressed avi video clip. With VirtualDub save the image clips before and after (pre,post) the modified brief clip and then reassemble the pre, modified, and post video clips. Output the audio from the original file to a wav file. Then use VirtualDub to output the new combined video file with the audio to a single combined file. Reencode the new uncompressed file.

ernstblaauw
22nd November 2003, 23:23
Originally posted by John2002
It would be much easier to recapture the video with a setting that's easier on the computer to avoid the dropped frames. However, you could use VirtualDub to save out the whole video clip to an uncompressed file. Then save out a brief clip (like 1 second) that includes the dropped frames. Use TMPGEnc to save out all the frames to image files, then an image editting program to combine the two frames before and after the drop. Combine the two images as layers and make the top image 50% transparent and save this image to replace the frame image where the drop occured. Use TMPGEnc to reassemble the images back to an uncompressed avi video clip. With VirtualDub save the image clips before and after (pre,post) the modified brief clip and then reassemble the pre, modified, and post video clips. Output the audio from the original file to a wav file. Then use VirtualDub to output the new combined video file with the audio to a single combined file. Reencode the new uncompressed file.
Of course it is much better to avoid dropped frames, but my MJPEG codec doesn't report correctly the dropped frames. I found out later that there were a lot of dropped frames, so it would take far too much effort to recapture all the clips. And I can do it by hand, but I'm looking for a program which does the job automatically.

mustardman
23rd November 2003, 12:08
Interpolating adjacent frames would work OK if there was almost no motion, but if you are seeing a jerk, there must be some motion in the first place.

I think you are really pushing it uphill to interpolate and get sensible results.

Like erratic suggests, Dynapel Motion Perfect is the only frame interpolator I know of. I tried it, but it didn't work for me (mind you, I was doing some pretty unusual stuff!).

A script in AVISynth can find dropped frames easily, so you can scan a file and find them at least. After that, well, it's up to you!

MustardMan.