MoneyPrinter
MoneyPrinter copied to clipboard
[BUG] Video generation fails when creating subtitles locally.
Describe the bug Video generation fails after MoviePy finishes. The next debug message is "Creating Subtitles Locally" and then comes an error: "Expected contiguous start of match or end of input at char 198, but started at char 483 (unmatched content: '2\n0:00:10,780 --> 0:00\nIn this video, we will explore the fascinating world of cars, from their history and evolution to their impact on society and the environment.\n\n1\n\n3\n0:00 --> 0:00:25,760\nEvolution of Cars:\n\nCars have come a long way since their invention in the late 19th century')"
The request returns an error and no output.mp4 is generated
To Reproduce Steps to reproduce the behavior:
- Cloned git repository
- Built MagickImage from linux source and installed on Ubuntu 22.04
- Updated .env file per ENV.md. ImageMagick is pointed to /usr/bin/local/magick where it was installed by make install
- Run main.py for the backend as suggested
- Send a JSON request to the backend endpoint from Postman on a remote machine:
{ "videoSubject": "Cars", "voice": "en_au_001" }
Expected behavior Video to be generated at ./temp/output.mp4
Observed behavior The video clips are downloaded and audio is generated into ./temp/, but the request errors and stops before the video is composited.
Interesting - I will disable local subtitles for now and look into what the issue is. Thanks for explaining so well.
I'm facing a issue with the same function while building a Docker image of the application. Im suspicious that the issue is on "AudioFileClip", since it raises the following error:
[10/11] RUN python3 Backend/main.py: 1.441 Traceback (most recent call last): 1.441 File "Backend/main.py", line 4, in
1.441 from video import * 1.441 File "/Backend/video.py", line 59, in 1.441 def __generate_subtitles_locally(sentences: list[str], audio_clips: list[AudioFileClip]) -> str: 1.441 TypeError: 'type' object is not subscriptable
I see the error, it's a list not List.
This will have to be imported from typing.
Can you open a PR?
Sure, done.
Interesting - I will disable local subtitles for now and look into what the issue is. Thanks for explaining so well.
I think after you turned it off you turned off all future steps of generation?
MoviePy - Writing audio in ../temp/a4268bf6-9f0a-4efa-a69a-78764f9c06f3.mp3
MoviePy - Done.
[-] Local subtitle generation has been disabled for the time being.
[-] Exiting.
Edit: I looked at the source, if you don't use Assembly_AI then the app just kills itself. Which is weird cause the .env said that feature is optional.
Interesting - I will disable local subtitles for now and look into what the issue is. Thanks for explaining so well.
I think after you turned it off you turned off all future steps of generation?
MoviePy - Writing audio in ../temp/a4268bf6-9f0a-4efa-a69a-78764f9c06f3.mp3 MoviePy - Done. [-] Local subtitle generation has been disabled for the time being. [-] Exiting.
Edit: I looked at the source, if you don't use Assembly_AI then the app just kills itself. Which is weird cause the .env said that feature is optional.
I literally just said I will turn it off.
So ist that mean (until this issue solved) it can't generate the finale video right now?
So ist that mean (until this issue solved) it can't generate the finale video right now?
You can, just provide your AssemblyAI API Key.