ArdenButterfield / stammer

Recreate any audio track by rearranging the frames of another video
MIT License
434 stars 29 forks source link

Assertion Error issue (assumed to be caused by long mudulation file, maybe) #62

Open astatinedeposit opened 1 year ago

astatinedeposit commented 1 year ago

running into an issue with the program. i think the issue may be the length of my audio file modulator file(25min), but I am unsure. (Im an absolutely illiterate idiot with technical code such as this) If I've done something dumb I apologise problem usually occurs 7099 frames through the "building output video" segment.

Traceback (most recent call last): File "C:\Users*name\Downloads\stammer-main\stammer-main\stammer.py", line 309, in main() File "C:\Users*name\Downloads\stammer-main\stammer-main\stammer.py", line 305, in main process(*vars(args)) File "C:\Users*name\Downloads\stammer-main\stammer-main\stammer.py", line 265, in process build_output_video(handler, matcher) File "C:\Users*name\Downloads\stammer-main\stammer-main\stammer.py", line 144, in build_output_video video_handler.write_frame(video_frame_i,video_handler.get_frame(carrier_video_frame+1)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*name\Downloads\stammer-main\stammer-main\video_out.py", line 90, in get_frame super().get_frame(idx) File "C:\Users*name*\Downloads\stammer-main\stammer-main\video_out.py", line 41, in get_frame assert(idx > self.framecount) ^^^^^^^^^^^^^^^^^^^^^ AssertionError

edit: i got a temp fix working by setting the output as .mp3

Firepal commented 1 year ago

You've done nothing wrong. Very probably a duplicate of #9 et al. I introduced this assert because of those issues.

I have a hunch the bug is located within build_output_video but I can't parse a lot of the frame length math in my brains :^)

onedez commented 1 year ago

I had this same problem too. Got the same exact stack traceback.

Calculating video length Separating video frames frame=129578 fps=412 q=-0.0 Lsize=N/A time=01:30:04.48 bitrate=N/A speed=17.2x reading audio analyzing audio creating output audio building output video Traceback (most recent call last): File "C:\Users\myname\Downloads\stammer-main\stammer-main\stammer.py", line 309, in main() File "C:\Users\myname\Downloads\stammer-main\stammer-main\stammer.py", line 305, in main process(**vars(args)) File "C:\Users\myname\Downloads\stammer-main\stammer-main\stammer.py", line 265, in process build_output_video(handler, matcher) File "C:\Users\myname\Downloads\stammer-main\stammer-main\stammer.py", line 144, in build_output_video video_handler.write_frame(video_frame_i,video_handler.get_frame(carrier_video_frame+1)) File "C:\Users\myname\Downloads\stammer-main\stammer-main\video_out.py", line 90, in get_frame super().get_frame(idx) File "C:\Users\myname\Downloads\stammer-main\stammer-main\video_out.py", line 41, in get_frame assert(idx < self.framecount) AssertionError

However, my modulator track isn't the long one. It's my carrier track that's long. (90 minutes) It was around uh.. 1100-1300 frames into the "building output video" process out of 5300 frames.

I'm running this on Windows 11.

I tried this twice and got the same error output.

Firepal commented 1 year ago

@ArdenButterfield Can you clear up the purpose of the +1 in line 144 of this code? https://github.com/ArdenButterfield/stammer/blob/d73334d7a357195657ba23bd11ed9f334662ad4a/stammer.py#L135-L144