Log in

View Full Version : Confused About Frames and Pictures


jweathers7
31st December 2005, 09:33
I have been using Womble MPEG Wizard to re-edit Attack of the Clones to insert the deleted material back into the film. I have been fairly successful with the exception of one final detail.

Some of Womble's transitions have problems and I decided to instead do them by hand via VirtualDub, The GIMP Script-Fu, and AviSynth. Most of the Womble transitions are 60 frames in length (according to Womble). To produce such a transition by hand, I use Womble to grab the last 60 frames of the left clip and the first 60 frames of the right clip. Then, I export these clips as VOB files, and the problems begin.

When I use ReMPEG2 to analyse the clips, it tells me that I have a certain number of pictures and a different number of frames. This confused me as I thought that each frame was a picture. When I then decode the VOB file into an uncompressed AVI which I then convert into a sequence of images, the resulting number of images is invariably fewer than the source VOB's frame count as given by Womble. Then, when I create the transitions and encode the resulting AVI file, the new MPEG-2 file has the same number as or one less than the number of images I used to create it and thus when I replace the Womble transition with my own, the video no longer has the same number of frames and becomes out of sync with the audio that I have already produced with the version that uses Womble transitions.

I tried to get around this by exporting AVI files of the clips directly from Womble, and sure enough Womble produces AVIs that are composed of the appropriate number of images. However, oddly enough these AVIs appear to have suffered some sort of problem during decoding as the colors appear slightly darker than the originals which then causes a problem when I use them to create manual transitions as the end transitions stick out like a sore thumb in the final video because of the color shifts.

I have my suspicions that this is caused by cutting on frames other than I-frames, but I'm not certain how to insure that I cut on an I-frame and with the descrepancy between ReMPEG2's picture count and frame count, I'm not certain anymore that I truly grok the frame concept.

Guest
1st January 2006, 08:29
MPEG2 encodes pictures. A picture can be either a field picture or a frame picture. Field pictures always come in pairs. A clip can have an arbitrary mix of field and frame coding (subject to MPEG2 syntax limitations).

jweathers7
1st January 2006, 18:53
Well, I seem to have found the answer to my problem.

It appears that Womble is reporting the number of frames after doing a 3:2 pulldown rather than the number of frames encoded in the raw VOB clip.

I have determined that I can preserve my clips frames and timing by doing the following:

Export the clip in MPEG Video Wizard as a VOB file.
Use DGIndex to create a d2v file with the "Ignore Pulldown Flags" option.
Use AVISynth and VirtualDub to retrieve the raw progressive frames.
Do my edits on the images.
Use VirtualDub to convert the images to an AVI with a 23.976 fps frame rate.
Encode the AVI file as an MPEG-2 video file.
Use DGPulldown to change the MPEG-2 video file so that it does the 3:2 pulldown and presents itself as 29.97 fps.


Importing the resulting file into Womble gives the appropriate time codes, lengths, and frames as the original clip.

Or almost.

Actually, on my test case, Womble reported 1845 frames for the original VOB and 1844 frames for the re-encoded version.

I'm certainly on the right track it would seem. This might be enough for me to fix my transition issues, but it would be nice to figure out why there is still the difference of 1 frame. In this particular test case, I used a whole VOB file instead of a clip from one extracted by Womble so I wouldn't think that there would be any issues regarding dangling frames or fields.

jweathers7
2nd January 2006, 11:45
Well, I've finally figured out where my missing frame went. Apparently, QuEnc is the cause of this final problem. I've begun to use HC instead for my encoding needs and not only does it fix the missing frame as reported by Womble, but it also seems to be doing a hell of a lot better job of encoding. A few of my reencoded clips before were show noticeable grain, but now my reencoded clips blend smoothly together with the rest of the untouched film!

I am a very happy camper.