Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg error #78

Open
thboon3 opened this issue Apr 28, 2024 · 8 comments
Open

ffmpeg error #78

thboon3 opened this issue Apr 28, 2024 · 8 comments

Comments

@thboon3
Copy link

thboon3 commented Apr 28, 2024

Error I received:

C:\Users\user\Downloads>python Subtitles.py
Extracting audio from S1E01...
Generating subtitles for S1E01... This might take a while.
Detected language: English
90%|█████████████████████████████████████████████████████████████▉ | 131739/146739 [07:44<00:52, 283.83frames/s]
Adding subtitles to S1E01...
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\user\miniconda3\Scripts\auto_subtitle.exe_main
.py", line 7, in
File "C:\Users\user\miniconda3\Lib\site-packages\auto_subtitle\cli.py", line 67, in main
).output(out_path).run(quiet=True, overwrite_output=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\miniconda3\Lib\site-packages\ffmpeg_run.py", line 325, in run
raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

I installed ffmpeg with pip install ffmpeg-python in my base env (before I used it with choco but I received an error saying ffmpeg couldn't be found).

I've put my .py file and the .mp4 file both in my Downloads folder, this is the content of the .py file:

import os
os.system('auto_subtitle "Downloads/S1E01.mp4" -o subtitled/')

Not sure what I did wrong.

Edit: I don't have an output folder (subtitled/) but I imagine this will get created if not found.

This is the full stderr:

stderr output:
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\user\miniconda3\Scripts\auto_subtitle.exe_main
.py", line 7, in
File "C:\Users\user\miniconda3\Lib\site-packages\auto_subtitle\cli.py", line 49, in main
audios = get_audio(args.pop("video"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\miniconda3\Lib\site-packages\auto_subtitle\cli.py", line 84, in get_audio
).run(quiet=True, overwrite_output=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\miniconda3\Lib\site-packages\ffmpeg_run.py", line 325, in run
raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

@bluepanda999
Copy link

I also get this error. It gets stuck, you need to kill the ffmpeg process for it to proceed.
I run this on a headless server to generate transcription by batches. Hopefully it gets fixed soon.

@Nishan666
Copy link

try:
pip install ffmpeg-python
instead of:
pip install ffmpeg

@thboon3
Copy link
Author

thboon3 commented May 6, 2024

try: pip install ffmpeg-python instead of: pip install ffmpeg

I did.

@Nishan666
Copy link

Error Correction and Usage Enhancement

Issue:

The command provided in the previous section encounters errors due to incorrect formatting and potential flag functionality issues.

Corrections:

  • Quotation Marks: Remove unnecessary double quotes around the file path.
  • Flag Functionality: Address potential issues with the -o flag.
  • Direct Terminal Usage: Suggest executing the command directly in the terminal for simplicity.

Correct Command:

auto_subtitle /home/nick/auto-subtitle/test1.mp4 --model tiny --srt_only True

Repository Reference:

For extracting subtitles from multiple videos simultaneously and obtaining both .vtt and .srt files, refer to my altered repository, similar to the provided command structure.

auto-subtitle Repository
Please refer to the last section of the README.md in the above Git repository for detailed instructions on how to perform bulk extraction of subtitles for all the videos in the folder

@MattiasLevlin
Copy link

MattiasLevlin commented May 19, 2024

I can confirm that the suggested option by @Nishan666 worked for me, i.e. passing --srt_only True as a flag additionally to the base command 👍 (OS: Windows 11)

# Not OK,  ffmpeg error
auto_subtitle video.mp4 -o subtitled/

# OK! Everything works and subtitles are printed to subtitled/ folder
auto_subtitle video.mp4 -o subtitled/ --srt_only True

Edit: Actually it appears that this issue and the same solution were both posted last year (2023):
#50

@Mashinow
Copy link

Mashinow commented May 20, 2024

I tried to fix this error #81

@marcpozas
Copy link

I tried to fix this error #81

Your commit works perfectly for me. Thank you!

@Delivator
Copy link

try: pip install ffmpeg-python instead of: pip install ffmpeg

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants