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._run.Error: ffprobe error #46

Closed
fakeid30 opened this issue Oct 6, 2019 · 21 comments
Closed

ffmpeg._run.Error: ffprobe error #46

fakeid30 opened this issue Oct 6, 2019 · 21 comments
Assignees
Labels
bug Something isn't working

Comments

@fakeid30
Copy link

fakeid30 commented Oct 6, 2019

While trying to run the program in Arch Linux 64 bit I see this error :

INFO:subsync.subsync:computing alignments...
INFO:subsync.speech_transformers:extracting speech segments from subtitles...
Traceback (most recent call last):
  File "/home/nirjhor/.local/bin/subsync", line 11, in <module>
    load_entry_point('subsync==0.2.10', 'console_scripts', 'subsync')()
  File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/subsync.py", line 74, in main
    reference_pipe.fit_transform(args.reference)
  File "/home/nirjhor/.local/lib/python3.7/site-packages/sklearn/pipeline.py", line 393, in fit_transform
    return last_step.fit_transform(Xt, y, **fit_params)
  File "/home/nirjhor/.local/lib/python3.7/site-packages/sklearn/base.py", line 553, in fit_transform
    return self.fit(X, **fit_params).transform(X)
  File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/speech_transformers.py", line 54, in fit
    total_duration = float(ffmpeg.probe(fname)['format']['duration']) - self.start_seconds
  File "/home/nirjhor/.local/lib/python3.7/site-packages/ffmpeg/_probe.py", line 23, in probe
    raise Error('ffprobe', out, err)
ffmpeg._run.Error: ffprobe error (see stderr output for detail)

What I tried:

  • Installing as user in pip

  • reinstalling subsync

  • tried with --encoding utf-8 & utf-16

What I expect to happen:

The program should run

What happens:

I see the above-mentioned error

@smacke
Copy link
Owner

smacke commented Oct 6, 2019

Hi there,

Thanks very much for filing an issue.

Some context: we use the ffprobe utility from the ffmpeg project to get the length of the video, so that we can create an accurate progress bar. This part seems to be breaking for you.

Could I trouble you to run

ffprobe your-video.mkv

and let me know what the output (both stdout and stderr) is?

Thanks in advance!

@smacke smacke self-assigned this Oct 6, 2019
@smacke smacke added the bug Something isn't working label Oct 6, 2019
@fakeid30
Copy link
Author

fakeid30 commented Oct 6, 2019

ffprobe version n4.2.1 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 9.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, matroska,webm, from 'The+Walking+Dead+S01E01+-+Days+Gone+Bye.mkv':
  Metadata:
    CREATION_TIME   : 
    ENCODER         : Lavf55.12.0
  Duration: 01:07:07.35, start: 3.224000, bitrate: 1693 kb/s
    Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp (default)
    Metadata:
      title           : Surround
      LANGUAGE        : eng
    Stream #0:2(ara): Subtitle: ass
    Stream #0:3(cze): Subtitle: ass
    Stream #0:4(dan): Subtitle: ass
    Stream #0:5(dut): Subtitle: ass
    Stream #0:6(eng): Subtitle: ass
    Stream #0:7(per): Subtitle: ass
    Stream #0:8(fre): Subtitle: ass
    Stream #0:9(vie): Subtitle: ass
    Stream #0:10(ind): Subtitle: ass
    Stream #0:11(ita): Subtitle: ass

@smacke
Copy link
Owner

smacke commented Oct 6, 2019

Thanks very much for the quick response! We're starting to narrow things down. Since ffprobe worked fine for you, I think this is probably an issue with how the wrapper library ffmpeg-python interprets the output. I'll need to try to reproduce the issue before I can be sure it's their fault, though, and this might take some time.

For now, I'm going to add a stopgap measure since getting the progress bar is nice, but not crucial for functionality. If there's an exception, I'll just have it continue without the duration information rather than completely failing.

I'll reply to this thread once it's done, and hopefully we can get things working for you.

@smacke
Copy link
Owner

smacke commented Oct 6, 2019

@fakeid30 when you have a chance, could I trouble you to try reinstalling subsync and running your command again? I'd love to hear whether it works now (without progress info unfortunately, but better than not working at all).

You can grab the latest with:

pip install --upgrade git+https://github.com/smacke/subsync@stable

@fakeid30
Copy link
Author

fakeid30 commented Oct 6, 2019

@smacke New error

NFO:subsync.speech_transformers:...done.
Traceback (most recent call last):
  File "/home/nirjhor/.local/bin/subsync", line 11, in <module>
    load_entry_point('subsync==0.2.11', 'console_scripts', 'subsync')()
  File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/subsync.py", line 74, in main
    reference_pipe.fit_transform(args.reference)
  File "/home/nirjhor/.local/lib/python3.7/site-packages/sklearn/pipeline.py", line 393, in fit_transform
    return last_step.fit_transform(Xt, y, **fit_params)
  File "/home/nirjhor/.local/lib/python3.7/site-packages/sklearn/base.py", line 553, in fit_transform
    return self.fit(X, **fit_params).transform(X)
  File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/speech_transformers.py", line 97, in fit
    for media_bstring in media_bstrings]
  File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/speech_transformers.py", line 97, in <listcomp>
    for media_bstring in media_bstrings]
  File "<__array_function__ internals>", line 6, in concatenate
ValueError: need at least one array to concatenate
[nirjhor@nirjhor-arch Downloads]$ 

@smacke
Copy link
Owner

smacke commented Oct 6, 2019

@fakeid30 this is embarrassing, it looks like you've uncovered 2 completely unrelated bugs -- the new one is that somehow audio extraction isn't working.

There are any number of reasons this could be happening; to do a full investigation I would need to run arch linux in a VM and get the exact video you're using in order to replicate the environment as closely as possible.

I have an educated guess, however. On darwin, stdout.read is blocking. It's possible that for you it's non-blocking, and that stdout.read executes before the ffmpeg process has a chance to put any bytes in buffers. I tried explicitly clearing the O_NONBLOCK flag in case this is what's happening.

Thanks again so much for all your help so far with debugging. If you have another moment, I'm very interested to hear whether the most recent problem still occurs after you do

pip install --upgrade git+https://github.com/smacke/subsync@stable

I don't expect that it will work, in which case I'll need to do a more thorough investigation later, but it would be awesome if it does!

@fakeid30
Copy link
Author

fakeid30 commented Oct 6, 2019

Seeing this error now @smacke

INFO:subsync.speech_transformers:extracting speech segments from subtitles...
INFO:subsync.speech_transformers:extracting speech segments from video TThe+Walking+Dead+S01E01+-+Days+Gone+Bye.mkv...
0it [00:00, ?it/s]
INFO:subsync.speech_transformers:...done.
Traceback (most recent call last):
  File "/home/nirjhor/.local/bin/subsync", line 11, in <module>
    load_entry_point('subsync==0.2.12', 'console_scripts', 'subsync')()
  File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/subsync.py", line 74, in main
    reference_pipe.fit_transform(args.reference)
  File "/home/nirjhor/.local/lib/python3.7/site-packages/sklearn/pipeline.py", line 393, in fit_transform
    return last_step.fit_transform(Xt, y, **fit_params)
  File "/home/nirjhor/.local/lib/python3.7/site-packages/sklearn/base.py", line 553, in fit_transform
    return self.fit(X, **fit_params).transform(X)
  File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/speech_transformers.py", line 101, in fit
    for media_bstring in media_bstrings]
  File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/speech_transformers.py", line 101, in <listcomp>
    for media_bstring in media_bstrings]
  File "<__array_function__ internals>", line 6, in concatenate
ValueError: need at least one array to concatenate
[nirjhor@nirjhor-arch Downloads]$ 

@fakeid30
Copy link
Author

fakeid30 commented Oct 6, 2019

@smacke I have 2 things for you

@RealEnder
Copy link

Just tested the current HEAD on Arch Linux ARM installation. I had some issues with installation of required libraries, so I had to install scikit-learn (0.21.3) and numpy (1.17.2) from distro packages. Then everything worked as expected. Also tested with @fakeid30's files, which also worked. My ffmpeg-python version is 0.2.0.

@fakeid30
Copy link
Author

fakeid30 commented Oct 7, 2019

I can indeed confirm that installing "python-scikit-learn" has solved my issue. Thanks @RealEnder

@fakeid30 fakeid30 closed this as completed Oct 7, 2019
@smacke smacke added bug Something isn't working and removed bug Something isn't working labels Oct 7, 2019
@smacke
Copy link
Owner

smacke commented Oct 7, 2019

@RealEnder @fakeid30 Really appreciate the time you all took to find / reproduce a fix. I did not expect there was something going on with scikit-learn at all and was definitely going in the wrong direction!

I'm curious what version of sklearn you all were running. At this point my best guess is that somehow the sklearn pipeline was passing None in for fname, maybe because the pipeline object wasn't correctly forwarding fname to the first transformer when pipeline.fit(fname) was invoked.

I'm going to bump the min required version of scikit-learn to 0.20.4 and hope that it either fixes the issue, or that we'll fail fast at install time if that version can't be found in PyPI.

@fakeid30
Copy link
Author

fakeid30 commented Oct 8, 2019

@smacke 0.21.3 fixed it for me, I had some previous version installed (how to check)?

@fakeid30
Copy link
Author

fakeid30 commented Oct 8, 2019

Ok so I checked the changelog and I am sure this happened because you had 0.21.3 before and that package is not available hence it did not get downloaded at all.

Thus, manually installing the version fixed it.

@schults
Copy link

schults commented Feb 21, 2020

@fakeid30 and @smacke

I'm having this same error

INFO:subsync.speech_transformers:extracting speech segments from subtitles...
INFO:subsync.speech_transformers:extracting speech segments from video TThe+Walking+Dead+S01E01+-+Days+Gone+Bye.mkv...
0it [00:00, ?it/s]
INFO:subsync.speech_transformers:...done.
Traceback (most recent call last):
File "/home/nirjhor/.local/bin/subsync", line 11, in
load_entry_point('subsync==0.2.12', 'console_scripts', 'subsync')()
File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/subsync.py", line 74, in main
reference_pipe.fit_transform(args.reference)
File "/home/nirjhor/.local/lib/python3.7/site-packages/sklearn/pipeline.py", line 393, in fit_transform
return last_step.fit_transform(Xt, y, **fit_params)
File "/home/nirjhor/.local/lib/python3.7/site-packages/sklearn/base.py", line 553, in fit_transform
return self.fit(X, **fit_params).transform(X)
File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/speech_transformers.py", line 101, in fit
for media_bstring in media_bstrings]
File "/home/nirjhor/.local/lib/python3.7/site-packages/subsync/speech_transformers.py", line 101, in
for media_bstring in media_bstrings]
File "<array_function internals>", line 6, in concatenate
ValueError: need at least one array to concatenate

I updated the everything and still getting this error. How can I fix this?

@smacke
Copy link
Owner

smacke commented Feb 24, 2020

@schults I usually see this error when the sync itself fails. The experimental branch has some improved features for syncing; I recommend trying to grab that one:
pip install git+https://github.com/smacke/subsync@experimental

Please let me know if this helps!

@schults
Copy link

schults commented Mar 6, 2020

@smacke thanks for helping me and sorry for the delay ! I tried here and that error it's not appearing anymore :)

@smacke
Copy link
Owner

smacke commented Mar 13, 2020

@schults thanks for the update and very glad to hear it!

@pannal
Copy link

pannal commented Apr 1, 2020

I still have this issue (tried with stable and experimental):

INFO:subsync.subsync:extracting speech segments from reference 'fn.mkv'...
INFO:subsync.speech_transformers:Checking video for subtitles stream...
INFO:subsync.speech_transformers:Video file appears to lack subtitle stream
WARNING:subsync.speech_transformers:ffprobe error (see stderr output for detail)
0it [00:00, ?it/s]
Traceback (most recent call last):
  File "c:\python35\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python35\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\python35\scripts\subsync.exe\__main__.py", line 7, in <module>
  File "c:\python35\lib\site-packages\subsync\subsync.py", line 207, in main
    return run(args)
  File "c:\python35\lib\site-packages\subsync\subsync.py", line 81, in run
    reference_pipe.fit(args.reference)
  File "c:\python35\lib\site-packages\sklearn\pipeline.py", line 354, in fit
    self._final_estimator.fit(Xt, y, **fit_params)
  File "c:\python35\lib\site-packages\subsync\speech_transformers.py", line 213, in fit
    self.video_speech_results_ = np.concatenate(media_bstring)
ValueError: need at least one array to concatenate

@pannal
Copy link

pannal commented Apr 1, 2020

Scratch that. The path to the MKV was wrong and the output is pretty misleading.

@smacke
Copy link
Owner

smacke commented Apr 1, 2020

@pannal Thanks for flagging; I'll add a more informative error message. (#63)

@LanGuipeng
Copy link

when I run python swap.py fsgan/docs/examples/shinzo_abe.mp4 -t fsgan/docs/examples/conan_obrien.mp4 -o . An error is thrown: ffmpeg._run.Error: ffprobe error (see stderr output for detail). so how can I solve the problem? thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants