steinathan / reelsmaker

ReelsMaker is a Python-based/streamlit application designed to create captivating faceless videos for social media platforms like TikTok and YouTube.
https://voidface.fly.dev
MIT License
181 stars 24 forks source link

I am getting file name too long error. and when i checked the file does not even exist in the path! #27

Open Usgupta opened 1 month ago

Usgupta commented 1 month ago

`2024-10-14 12:09:59.050 | INFO | app.reels_maker:init:75 - Starting Reels Maker with: {'cwd': '/Users/umanggupta/reelsmaker/tmp/a80e02c9-44c3-40ae-8c8a-cdeb481e1202', 'prompt': '', 'sentence': 'Each of us lives dependent and bound by our individual knowledge and our awareness All that is what we call reality However both knowledge and awareness are equivocal Ones reality might be anothers illusion We all live inside our own fantasies', 'background_audio_url': '', 'background_music_path': None, 'video_paths': [], 'video_gen_config': {'fontsize': 80, 'stroke_color': '#000000', 'text_color': '#ffffff', 'stroke_width': 2, 'font_path': 'fonts/bold_font.ttf', 'bg_color': '#000000', 'subtitles_position': 'center,center', 'threads': 11, 'watermark_path': None}, 'synth_config': {'voice_provider': 'tiktok', 'voice': 'en_male_narration'}} 2024-10-14 12:09:59.050 | DEBUG | app.reels_maker:start:149 - Generating search terms for script... 2024-10-14 12:09:59.051 | DEBUG | app.reels_maker:generate_search_terms:103 - Generating search terms for script... 2024-10-14 12:09:59.056 | DEBUG | app.prompt_gen:generate_hashtags:60 - Generating sentence from prompt: Each of us lives dependent and bound by our individual knowledge and our awareness All that is what we call reality However both knowledge and awareness are equivocal Ones reality might be anothers illusion We all live inside our own fantasies 2024-10-14 12:10:00.507 | INFO | app.reels_maker:generate_search_terms:110 - Generated search terms: ['knowledge', 'awareness', 'reality', 'illusion', 'fantasy', 'perspective', 'individual', 'truth', 'subjective', 'mindset'] 2024-10-14 12:10:01.668 | INFO | app.reels_maker:download_resource:87 - Downloading resource from: https://videos.pexels.com/video-files/1793334/1793334-hd_1920_1080_30fps.mp4 2024-10-14 12:10:01.678 | INFO | app.reels_maker:download_resource:87 - Downloading resource from: https://videos.pexels.com/video-files/3960160/3960160-uhd_4096_2160_25fps.mp4 2024-10-14 12:10:04.593 | DEBUG | app.reels_maker:download_resource:91 - Downloaded resource from: https://videos.pexels.com/video-files/1793334/1793334-hd_1920_1080_30fps.mp4 2024-10-14 12:10:05.478 | DEBUG | app.reels_maker:download_resource:91 - Downloaded resource from: https://videos.pexels.com/video-files/3960160/3960160-uhd_4096_2160_25fps.mp4 2024-10-14 12:10:05.486 | INFO | app.synth_gen:generate_audio:88 - Synthesizing text: Each of us lives dependent and bound by our individual knowledge and our awareness All that is what we call reality However both knowledge and awareness are equivocal Ones reality might be anothers illusion We all live inside our own fantasies [+] TikTok TTS Service available! [+] Audio file saved successfully as '/Users/umanggupta/reelsmaker/tmp/a80e02c9-44c3-40ae-8c8a-cdeb481e1202/audio_chunks/027b3898-d8fe-4256-85f7-1bc6a2c11f76.mp3' 2024-10-14 12:10:07.095 | ERROR | main:main:180 - removed from queue: a80e02c9-44c3-40ae-8c8a-cdeb481e1202: -> [Errno 63] File name too long: '/Users/umanggupta/reelsmaker/cache/speech_cache/en_male_narration_RWFjaCBvZiB1cyBsaXZlcyBkZXBlbmRlbnQgYW5kIGJvdW5kIGJ5IG91ciBpbmRpdmlkdWFsIGtub3dsZWRnZSBhbmQgb3VyIGF3YXJlbmVzcyBBbGwgdGhhdCBpcyB3aGF0IHdlIGNhbGwgcmVhbGl0eSBIb3dldmVyIGJvdGgga25vd2xlZGdlIGFuZCBhd2FyZW5lc3MgYXJlIGVxdWl2b2NhbCBPbmVzIHJlYWxpdHkgbWlnaHQgYmUgYW5vdGhlcnMgaWxsdXNpb24gV2UgYWxsIGxpdmUgaW5zaWRlIG91ciBvd24gZmFudGFzaWVz.mp3' Traceback (most recent call last):

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 1032, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0x101182020> └ <Thread(ScriptRunner.scriptThread, started 13306507264)>

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 1075, in _bootstrap_inner self.run() │ └ <function Thread.run at 0x101181d00> └ <Thread(ScriptRunner.scriptThread, started 13306507264)>

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 1012, in run self._target(*self._args, **self._kwargs) │ │ │ │ │ └ {} │ │ │ │ └ <Thread(ScriptRunner.scriptThread, started 13306507264)> │ │ │ └ () │ │ └ <Thread(ScriptRunner.scriptThread, started 13306507264)> │ └ <bound method ScriptRunner._run_script_thread of ScriptRunner(_session_id='f6542bf4-512d-4053-909e-f8703f8d37b5', _main_scrip... └ <Thread(ScriptRunner.scriptThread, started 13306507264)>

File "/Users/umanggupta/Library/Caches/pypoetry/virtualenvs/autoreelsmaker-rrXeMMWO-py3.12/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 309, in _run_script_thread self._run_script(request.rerun_data) │ │ │ └ <property object at 0x1051b9440> │ │ └ ScriptRequest(type=<ScriptRequestType.RERUN: 'RERUN'>, _rerun_data=RerunData(widget_states=widgets { │ │ id: "$$WIDGET_ID-41825... │ └ <function ScriptRunner._run_script at 0x1051c2d40> └ ScriptRunner(_session_id='f6542bf4-512d-4053-909e-f8703f8d37b5', _main_script_path='reelsmaker.py', _sessionstate={$$WIDGET... File "/Users/umanggupta/Library/Caches/pypoetry/virtualenvs/autoreelsmaker-rrXeMMWO-py3.12/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in _run_script exec(code, module.dict) │ │ └ <member 'dict' of 'module' objects> │ └ <module 'main' from '/Users/umanggupta/reelsmaker/reelsmaker.py'> └ <code object at 0x12f007cc0, file "/Users/umanggupta/reelsmaker/reelsmaker.py", line 1>

File "/Users/umanggupta/reelsmaker/reelsmaker.py", line 185, in asyncio.run(main()) │ │ └ <function main at 0x317184180> │ └ <function run at 0x103678d60> └ <module 'asyncio' from '/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/as...

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) │ │ └ <coroutine object main at 0x12f10acd0> │ └ <function Runner.run at 0x10368c360> └ <asyncio.runners.Runner object at 0x3170fd640>

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) │ │ │ └ <Task pending name='Task-99' coro=<main() running at /Users/umanggupta/reelsmaker/reelsmaker.py:180> cb=[_run_untilcomplete... │ │ └ <function BaseEventLoop.run_until_complete at 0x103695da0> │ └ <_UnixSelectorEventLoop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0x3170fd640>

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() │ └ <function BaseEventLoop.run_forever at 0x103695d00> └ <_UnixSelectorEventLoop running=True closed=False debug=False>

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() │ └ <function BaseEventLoop._run_once at 0x103697b00> └ <_UnixSelectorEventLoop running=True closed=False debug=False>

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 1986, in _run_once handle._run() │ └ <function Handle._run at 0x103623560> └ <Handle Task.task_wakeup(<_GatheringFu...0_25fps.mp4']>)>

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) │ │ │ │ │ └ <member '_args' of 'Handle' objects> │ │ │ │ └ <Handle Task.task_wakeup(<_GatheringFu...0_25fps.mp4']>)> │ │ │ └ <member '_callback' of 'Handle' objects> │ │ └ <Handle Task.task_wakeup(<_GatheringFu...0_25fps.mp4']>)> │ └ <member '_context' of 'Handle' objects> └ <Handle Task.task_wakeup(<_GatheringFu...0_25fps.mp4']>)>

File "/Users/umanggupta/reelsmaker/reelsmaker.py", line 174, in main video_path = await reels_maker.start() │ └ <function ReelsMaker.start at 0x3170dec00> └ <app.reels_maker.ReelsMaker object at 0x10362ff80>

File "/Users/umanggupta/reelsmaker/app/reels_maker.py", line 182, in start audio_path = await self.synth_text(sentence) │ │ └ 'Each of us lives dependent and bound by our individual knowledge and our awareness All that is what we call reality However ... │ └ <function ReelsMaker.synth_text at 0x3170deac0> └ <app.reels_maker.ReelsMaker object at 0x10362ff80>

File "/Users/umanggupta/reelsmaker/app/reels_maker.py", line 114, in synth_text return await self.syth_generator.generate_audio(text) │ │ │ └ 'Each of us lives dependent and bound by our individual knowledge and our awareness All that is what we call reality However ... │ │ └ <function SynthGenerator.generate_audio at 0x3170dccc0> │ └ <app.synth_gen.SynthGenerator object at 0x3145c7800> └ <app.reels_maker.ReelsMaker object at 0x10362ff80>

File "/Users/umanggupta/reelsmaker/app/synth_gen.py", line 97, in generate_audio await self.cache_speech(text) │ │ └ 'Each of us lives dependent and bound by our individual knowledge and our awareness All that is what we call reality However ... │ └ <function SynthGenerator.cache_speech at 0x3170dcc20> └ <app.synth_gen.SynthGenerator object at 0x3145c7800>

File "/Users/umanggupta/reelsmaker/app/synth_gen.py", line 75, in cache_speech shutil.copy2(self.speech_path, speech_path) │ │ │ │ └ '/Users/umanggupta/reelsmaker/cache/speech_cache/en_male_narration_RWFjaCBvZiB1cyBsaXZlcyBkZXBlbmRlbnQgYW5kIGJvdW5kIGJ5IG91ci... │ │ │ └ '/Users/umanggupta/reelsmaker/tmp/a80e02c9-44c3-40ae-8c8a-cdeb481e1202/audio_chunks/027b3898-d8fe-4256-85f7-1bc6a2c11f76.mp3' │ │ └ <app.synth_gen.SynthGenerator object at 0x3145c7800> │ └ <function copy2 at 0x101d49760> └ <module 'shutil' from '/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shu...

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 475, in copy2 copyfile(src, dst, follow_symlinks=follow_symlinks) │ │ │ └ True │ │ └ '/Users/umanggupta/reelsmaker/cache/speech_cache/en_male_narration_RWFjaCBvZiB1cyBsaXZlcyBkZXBlbmRlbnQgYW5kIGJvdW5kIGJ5IG91ci... │ └ '/Users/umanggupta/reelsmaker/tmp/a80e02c9-44c3-40ae-8c8a-cdeb481e1202/audio_chunks/027b3898-d8fe-4256-85f7-1bc6a2c11f76.mp3' └ <function copyfile at 0x101d49440>

File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 262, in copyfile with open(dst, 'wb') as fdst: └ '/Users/umanggupta/reelsmaker/cache/speech_cache/en_male_narration_RWFjaCBvZiB1cyBsaXZlcyBkZXBlbmRlbnQgYW5kIGJvdW5kIGJ5IG91ci...

OSError: [Errno 63] File name too long: '/Users/umanggupta/reelsmaker/cache/speech_cache/en_male_narration_RWFjaCBvZiB1cyBsaXZlcyBkZXBlbmRlbnQgYW5kIGJvdW5kIGJ5IG91ciBpbmRpdmlkdWFsIGtub3dsZWRnZSBhbmQgb3VyIGF3YXJlbmVzcyBBbGwgdGhhdCBpcyB3aGF0IHdlIGNhbGwgcmVhbGl0eSBIb3dldmVyIGJvdGgga25vd2xlZGdlIGFuZCBhd2FyZW5lc3MgYXJlIGVxdWl2b2NhbCBPbmVzIHJlYWxpdHkgbWlnaHQgYmUgYW5vdGhlcnMgaWxsdXNpb24gV2UgYWxsIGxpdmUgaW5zaWRlIG91ciBvd24gZmFudGFzaWVz.mp3'`

Usgupta commented 1 month ago

I am running on mac silicon and using poetry

steinathan commented 1 month ago

I get the issue, but I'm very busy to make a PR

but if you replace this line: https://github.com/steinathan/reelsmaker/blob/75369c382628d2d1f16ac99403ac8a2ffb055bd3/app/synth_gen.py#L41

with this

text_hash = hashlib.sha256(text.encode()).hexdigest()
Usgupta commented 1 month ago

this works, thanks for the quick resolution!