MoneyPrinter icon indicating copy to clipboard operation
MoneyPrinter copied to clipboard

[BUG] Videoclips are too short for the actual script and stop at a still image.

Open radry opened this issue 5 months ago • 5 comments

Describe the bug In a video I generated most of the clips are too short and stop playing although the text/voice continues. Only after a new "paragraph" a new clip is loaded. The result is a still image until the paragraph is finished.

Expected behavior The next clip is played when the previous one finishes instead of just stopping at a still image.

Screenshots Sample video: https://drive.google.com/file/d/1h_MSsMkskG3aUy775u0MRUgSiNBLQwO1/view

Desktop (please complete the following information):

  • OS: Windows
  • Browser Firefox
  • Python Version 3.11

radry avatar Feb 07 '24 17:02 radry

Can I try to work on this?

gabrielrosendo avatar Feb 07 '24 18:02 gabrielrosendo

Can I try to work on this?

Sure, I'd appreciate it as I'm low on time 🙏

FujiwaraChoki avatar Feb 07 '24 18:02 FujiwaraChoki

I set up everything but I am having issues with the request to g4f.ChatCompletion.create(). It gives me ClientConnectorCertificateError: Cannot connect to host chat.chatgptdemo.net:443 Any ideas why?

gabrielrosendo avatar Feb 07 '24 18:02 gabrielrosendo

I set up everything but I am having issues with the request to g4f.ChatCompletion.create(). It gives me ClientConnectorCertificateError: Cannot connect to host chat.chatgptdemo.net:443 Any ideas why?

It's probably due to rate limits, try turning on a VPN, that helps usually.

FujiwaraChoki avatar Feb 07 '24 19:02 FujiwaraChoki

Found an easy solution but don't have time to test right now: in video.py "combine_videos" where it sets the clip length, just loop the video if the clip length is shorter than what it should be.

I also found two other bugs related to this where it doesn't download 5 videos but fewer and thus not enough length in each video is available. I can fix it tomorrow, no time to open a separate issue now.

radry avatar Feb 07 '24 23:02 radry

I followed all instructions but keep getting: [-] Error: RetryProvider failed: Gpt6: ClientConnectorCertificateError: Cannot connect to host seahorse-app-d29hu.ondigitalocean.app:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')] Chatgpt4Online: URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)> You: ClientConnectorCertificateError: Cannot connect to host you.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')] FreeGpt: ClientConnectorCertificateError: Cannot connect to host s.aifree.site:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')] FakeGpt: ClientConnectorCertificateError: Cannot connect to host chat-shared2.zhile.io:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')] ChatgptDemoAi: ClientConnectorError: Cannot connect to host chat.chatgptdemo.ai:443 ssl:default [Connection reset by peer] ChatgptDemo: ClientConnectorCertificateError: Cannot connect to host chat.chatgptdemo.net:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')] ChatgptNext: ClientConnectorCertificateError: Cannot connect to host chat.fstha.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')] GeekGpt: HTTPError: 521 Server Error: for url: https://ai.fakeopen.com/v1/chat/completions Let me know if there is a fix and I can try working on this.

gabrielrosendo avatar Feb 08 '24 06:02 gabrielrosendo

Please open an issue in the xtekky/gpt4free package, as MoneyPrinter isn't related to g4f.

FujiwaraChoki avatar Feb 08 '24 07:02 FujiwaraChoki

After investigating more, I can conclude that the problem is that many of the downloaded clips are simply too short for the calculated length. This can easily be solved by downloading more video instead of just 5 or looping a video. A better solution would be to dynamically adjust the amount of videos downloaded but this takes more time and effort to implement properly.

radry avatar Feb 08 '24 10:02 radry

As @radry is pointing out, the best solution here would be to dynamically fetch enough videos to fill the audio track duration.

I did a quickfix by commenting out this line in video.py. Then the video will transition to the next as soon as it has ended.

image

You can modify the AMOUNT_OF_STOCK_VIDEOS constant in main.py accordingly to fetch enough videos to fill the audio track duration. Not a very consistent approach, but better than the current implementation, in my opinion

zanmat0 avatar Feb 08 '24 14:02 zanmat0

@zanmat0 It currently makes every clip the same length and doesn't consider the real available length. I was thinking of comparing the calculated clip length with the actual video length of each clip and dynamically adjust the length of each clip depending on the actual length. That means if a clip is too short it will play more of another one. Sounds a bit complicated though.

Your suggestion has the downside that it will only play a single clip if it's very long

radry avatar Feb 08 '24 14:02 radry