Manual tool extraction issues

The Extraction process failing on you, and you aren't getting an error back with clear instructions? Tell us about it here


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for reporting errors with the Extraction process. If you want to get tips, or better understand the Extract process, then you should look in the Extract Discussion forum.

Please mark any answers that fixed your problems so others can find the solutions.

Post Reply
User avatar
kellurian
Posts: 9
Joined: Fri Jul 12, 2019 5:15 am
Has thanked: 3 times
Been thanked: 1 time

Manual tool extraction issues

Post by kellurian »

So I seemed to have found a bug and I haven't seen this in any of the other posts, but feel free to correct me if wrong. From time to time, whenever I go over an alignments file, I get this error "ERROR There is a mismatch between the number of frames found in the video file (44735) and the number of frames found in the alignments file (44736).
09/27/2021 18:24:25 ERROR This can be caused by a number of issues:
09/27/2021 18:24:25 ERROR - The video has a Variable Frame Rate and FFMPEG is having a hard time calculating the correct number of frames.
09/27/2021 18:24:25 ERROR - You are working with a Merged Alignments file. This is not supported for your current use case.
09/27/2021 18:24:25 ERROR You should either extract the video to individual frames, re-encode the video at a constant frame rate and re-run extraction or work with a dedicated alignments file for your requested video."

Usually its just a frame or two off, but the videos are not variable frame rate, and I don't have merged alignment files. It will convert the files fine, but it won't allow manual editing of the alignments. I think I have pinpointed this to files with frame rates that are decimals, like 23.98 frame/second as opposed to whole number frame rates like 24 frames/second. This is probably not a faceswap bug and probably has to do with ffmpeg, but until it can be fixed it seems that files where you are wanting to correct alignments need to be converted to a whole number frame rate before extraction, or we won't be able to manually correct the alignments. If this has been noted before, please forgive, but I couldn't find it anywhere.


User avatar
kellurian
Posts: 9
Joined: Fri Jul 12, 2019 5:15 am
Has thanked: 3 times
Been thanked: 1 time

Re: Manual tool extraction issues

Post by kellurian »

Well, I might be wrong about when it does the error. I just extracted a 30 fr/sec video and it did it again, once again one frame off. The extra frames seem to be in the alignments file and not the video it self. I did the "missing frames" alignment tool, and it stated that it was the last frame that was missing. Could the extraction tool be putting an extra frame or two at the end of some videos? I have not had this happen with every extracted video, but for me its close to 50% of the time. I tried to see if the alignments tool might be responsible, like the original alignments file would be fine but the tool changes something after removing bad faces, but the original alignments file gave me the same error, just one frame off from the original. It is strange.


User avatar
torzdf
Posts: 1526
Joined: Fri Jul 12, 2019 12:53 am
Answers: 126
Has thanked: 54 times
Been thanked: 288 times

Re: Manual tool extraction issues

Post by torzdf »

It's been a while since I implemented this code, so I can't remember exactly what it does. However, iirc, this can happen for several reasons. Variable framerate being one. Video not cut on a keyframe being another.

The main issue is that working with video is a pain. These kind of issues don't show for other applications as frame accurate tracking is not important, but for Faceswap it is imperative. What may be happening (speculation) is that your video is not cut on a keyframe, so ffmpeg dummies in some frames until the first keyframe is hit. This causes the counts to go out of whack

Unfortunately covering all of these eventualities would be very difficult for me to fix in code, so the easiest fix is usually to re-encode the video and go again.

The reason this tends to happen in Manual tool and not the rest of faceswap is that the manual tool needs to be able to track each and every frame and be able to jump forward and backwards with frame accuracy. All other parts of the faceswap process just needs to read frames consecutively from beginning to end of the video file. No tracking is required.

My word is final


Post Reply