dxing97 / subs2cia

Condensed Immersive Audiovisual media generator from subtitles for language learning
MIT License
89 stars 10 forks source link

FileNotFoundError: [WinError 206] The filename or extension is too long #1

Closed KamiGim closed 3 years ago

KamiGim commented 4 years ago

Thank for create this awesome app, but I got this in the command line after execute it. Traceback (most recent call last): File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\SupabSama\AppData\Local\Programs\Python\Python37-32\Scripts\subs2cia.exe\__main__.py", line 9, in <module> File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\site-packages\subs2cia\cli.py", line 4, in main subs2cia.main.start() File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\site-packages\subs2cia\main.py", line 590, in start subs2cia(**args) File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\site-packages\subs2cia\main.py", line 481, in subs2cia use_absolute_numbering=absolute_numbering) File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\site-packages\subs2cia\main.py", line 417, in export_condensed_audio ffmpeg_condense_audio(audiofile=audiofile, sub_times=split, outfile=outfilesplit) File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\site-packages\subs2cia\main.py", line 120, in ffmpeg_condense_audio ffmpeg.run(combined, quiet=not verbose) File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\site-packages\ffmpeg\_run.py", line 320, in run overwrite_output=overwrite_output, File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\site-packages\ffmpeg\_run.py", line 285, in run_async args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "c:\users\supabsama\appdata\local\programs\python\python37-32\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 206] The filename or extension is too long can you help me out

dxing97 commented 4 years ago

Looks like it's an issue with how windows limits filenames to ~200 characters. Try renaming your input files to be shorter.

Edit: Looks like it may be an issue with how cmd.exe handles very long arguments (it can't). Try setting a threshold with -t to reduce the number of audio snippets. -t 1500 might be a good balance.

Edit2: This is likely due to the huge numbers of arguments that can be passed to ffmpeg when threshold and padding are 0 for subtitles with lots of lines to condense. In some cases this can exceed the windows argument limit of 32768 characters, resulting in this error.

dxing97 commented 3 years ago

Implemented a fix by writing filter arguments to a temporary file when ffmpeg arguments exceed 32766 characters.