views:

57

answers:

1

Please bear with me, I know that what I'm doing can sound strange, but I can guarantee there's a very good reason for that.

I took a movie with my camera, as avi. I imported the movie into iMovie and then exploded the single frames as PNG. Then I repacked these frames into mov using the following code

movie, error = QTMovie.alloc().initToWritableFile_error_(out_path, None)

mt = QTMakeTime(v, scale)
attrib = {QTAddImageCodecType: "jpeg"}

for path in png_paths:
    image = NSImage.alloc().initWithContentsOfFile_(path)
    movie.addImage_forDuration_withAttributes_(image, mt, attrib)
    movie.updateMovieFile()

The resulting mov works, but it looks like the frames are "nervous" and shaky when compared to the original avi, which appears smoother. The size of the two files is approximately the same, and both the export and repacking occurred at 30 fps. The pics also appear to be aligned, so it's not due to accidental shift of the frames.

My question is: by knowing the file formats and the process I performed, what is the probable cause of such result ? How can I fix it ?

A: 

One textbook reason for "shaky" images are field mode issues. Any chance you are working with interlaced material and got your field order messed up? This would cause the results you described...

As for how you may fix this using the API you're using (QTKit?) I am at loss, though, due to lacking experience with it.

Bjoern
I have no experience either. I did some research, and it could be that the original movie allows "tweening" while packing single images ruins this information, so the movements appear less fluid and more "shaky" due to their atomicity. I'm guessing here.
Stefano Borini