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

Print ffmpeg errors #23

Open
binarykitchen opened this issue Jan 6, 2023 · 10 comments
Open

Print ffmpeg errors #23

binarykitchen opened this issue Jan 6, 2023 · 10 comments

Comments

@binarykitchen
Copy link

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

@tommyct614
Copy link

Did you manage to solve this?

@binarykitchen
Copy link
Author

no

@tommyct614
Copy link

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

@binarykitchen
Copy link
Author

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
Copy link
Author

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

@tarasyyyk
Copy link

@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.

@binarykitchen
Copy link
Author

@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?

@mockinbirdy
Copy link

@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.

@Kavan27
Copy link

Kavan27 commented Jun 8, 2023

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

@zaltinsoy
Copy link

#89
Version in this pull request solved my path related problem in Windows.

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

6 participants