auto-subtitle icon indicating copy to clipboard operation
auto-subtitle copied to clipboard

Print ffmpeg errors

Open binarykitchen opened this issue 2 years ago • 10 comments

For unknown reasons the ffmpeg command fails without telling me why:

$ auto_subtitle ./videomail_preview.webm -o subtitled/

prints following:

Extracting audio from videomail_preview...
Generating subtitles for videomail_preview... This might take a while.
Detected language: English
  0%|                                                                                                                                                                                            | 0/69 [00:11<?, ?frames/s]
Adding subtitles to videomail_preview...
Traceback (most recent call last):
  File "/Users/michaelheuberger/.pyenv/versions/3.10.4/bin/auto_subtitle", line 33, in <module>
    sys.exit(load_entry_point('auto-subtitle==1.0', 'console_scripts', 'auto_subtitle')())
  File "/Users/michaelheuberger/.pyenv/versions/3.10.4/lib/python3.10/site-packages/auto_subtitle/cli.py", line 61, in main
    stderr = ffmpeg.concat(
  File "/Users/michaelheuberger/.pyenv/versions/3.10.4/lib/python3.10/site-packages/ffmpeg/_run.py", line 325, in run
    raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

On MacOS here, using python v3.10.4 installed via pyenv and using ffmpeg v5.1.2 - any clues? Thanks

binarykitchen avatar Jan 06 '23 05:01 binarykitchen

Did you manage to solve this?

tommyct614 avatar Feb 05 '23 02:02 tommyct614

no

binarykitchen avatar Feb 05 '23 02:02 binarykitchen

It worked for me by adding '--output_srt true' as a second argument.

tommyct614 avatar Feb 05 '23 06:02 tommyct614

Hmm, thanks mate but getting weirder errors now:

Traceback (most recent call last):
  File "/home/michael-heuberger/.pyenv/versions/3.11.1/bin/auto_subtitle", line 33, in <module>
    sys.exit(load_entry_point('auto-subtitle==1.0', 'console_scripts', 'auto_subtitle')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/michael-heuberger/.pyenv/versions/3.11.1/lib/python3.11/site-packages/auto_subtitle/cli.py", line 60, in main

    ).output(out_path).run(quiet=True, overwrite_output=True)

stderr
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/michael-heuberger/.pyenv/versions/3.11.1/lib/python3.11/site-packages/ffmpeg/_run.py", line 325, in run

    raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

stderr
23:54:07.714 ERROR [email protected]:
  0%|          | 0/657 [00:21<?, ?frames/s]
    Traceback (most recent call last):
      File "/home/michael-heuberger/.pyenv/versions/3.11.1/bin/auto_subtitle", line 33, in <module>
        sys.exit(load_entry_point('auto-subtitle==1.0', 'console_scripts', 'auto_subtitle')())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/michael-heuberger/.pyenv/versions/3.11.1/lib/python3.11/site-packages/auto_subtitle/cli.py", line 60, in main
        ).output(out_path).run(quiet=True, overwrite_output=True)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/michael-heuberger/.pyenv/versions/3.11.1/lib/python3.11/site-packages/ffmpeg/_run.py", line 325, in run
        raise Error('ffmpeg', out, err)
    ffmpeg._run.Error: ffmpeg error (see stderr output for detail)
    
23:54:07.746 TRACE [email protected]: client.onEnd (no event)
23:54:07.758 TRACE [email protected]: Received POST on /client-error/?x-videomail-site-name=videomail.io, processing now ...
Sun, 05 Feb 2023 10:54:07 GMT express deprecated req.host: Use req.hostname instead at node_modules/lodash/lodash.js:4837:28
23:54:07.799  WARN [email protected]:
    Oh no, server error!
  0%|          | 0/657 [00:21<?, ?frames/s]
    Traceback (most recent call last):
      File "/home/michael-heuberger/.pyenv/versions/3.11.1/bin/auto_subtitle", line 33, in <module>
        sys.exit(load_entry_point('auto-subtitle==1.0', 'console_scripts', 'auto_subtitle')())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/michael-heuberger/.pyenv/versions/3.11.1/lib/python3.11/site-packages/auto_subtitle/cli.py", line 60, in main
        ).output(out_path).run(quiet=True, overwrite_output=True)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/michael-heuberger/.pyenv/versions/3.11.1/lib/python3.11/site-packages/ffmpeg/_run.py", line 325, in run
        raise Error('ffmpeg', out, err)
    ffmpeg._run.Error: ffmpeg error (see stderr output for detail)
    "

binarykitchen avatar Feb 05 '23 10:02 binarykitchen

And funnily I wasn't talking nor saying anything during recording but it picked Nyorsk for the detected language hmmm...

binarykitchen avatar Feb 05 '23 11:02 binarykitchen

@binarykitchen You can edit source file /Users/michaelheuberger/.pyenv/versions/3.10.4/lib/python3.10/site-packages/auto_subtitle/cli.py, line 61 to get more verbose error output.

Or you can generate subtitle separately (with option --srt_only true) and then merge your video with this subtitle file: ffmpeg -i video.mp4 -i subtitle.srt -c copy -c:s mov_text output_video.mp4. Read more here on Stackoverflow about how to do it. Actually with this ffmpeg command you have more options to add subtitles: you can add soft/hard subs, change color, font, etc.

tarasyyyk avatar Feb 06 '23 14:02 tarasyyyk

@binarykitchen You can edit source file /Users/michaelheuberger/.pyenv/versions/3.10.4/lib/python3.10/site-packages/auto_subtitle/cli.py, line 61 to get more verbose error output.

Why not add a new verbose parameter to get this printed? And shouldn't any stderr output be shown by default anyway?

binarykitchen avatar Feb 06 '23 20:02 binarykitchen

@binarykitchen You can edit source file /Users/michaelheuberger/.pyenv/versions/3.10.4/lib/python3.10/site-packages/auto_subtitle/cli.py, line 61 to get more verbose error output.

Or you can generate subtitle separately (with option --srt_only true) and then merge your video with this subtitle file: ffmpeg -i video.mp4 -i subtitle.srt -c copy -c:s mov_text output_video.mp4. Read more here on Stackoverflow about how to do it. Actually with this ffmpeg command you have more options to add subtitles: you can add soft/hard subs, change color, font, etc.

Can you tell me what should be the command to run it without ffmpeg cause the error cannot seem to be fixed. Because it still shows me the same error even when I try to generate subtitles separately. Thanks.

mockinbirdy avatar May 20 '23 19:05 mockinbirdy

I fixed it by fixing the path, I had /videos/video.mp4 changed it to videos/video.mp4

Kavan27 avatar Jun 08 '23 02:06 Kavan27

https://github.com/m1guelpf/auto-subtitle/pull/89/ Version in this pull request solved my path related problem in Windows.

zaltinsoy avatar Jul 02 '24 13:07 zaltinsoy