Closed optionboom closed 1 year ago
Thanks for your work! The audio works great, but I'm not sure it quite handles video correctly yet? You call build_output_video(frames_dir, outframes_dir, matcher, 1/real_frame_length, output_path)
which sticks the frames from the matcher (at the custom frame rate) together at the source frame rate. This means that the audio and video gets out of sync, or even truncated, especially at high frame-rates. Instead, I think we'll need to do something a bit cleverer involving skipping or duplicating video frames.
I can give it a shot in a sec, unless you want to.
Oh, I see. Yeah, switching that to 1/frame_length should fix it, because it'll use the custom length if there is one and the source if there isn't. I can't test that right now so go ahead.
Edit: Never mind, that doesn't work.
i'm working on it now
I still want to tidy up the math some, but I think i solved it. Any thoughts?
Addresses #37. It's a little messy, but it works.
Example usage:
python stammer.py hams.mp4 song.mp3 hamsong.mp4 -f 0.1
will use frame lengths of 0.1 seconds.