Giter Club home page Giter Club logo

Comments (21)

fakeid30 avatar fakeid30 commented on August 15, 2024 2

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

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

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!

from ffsubsync.

fakeid30 avatar fakeid30 commented on August 15, 2024
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

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

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.

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

@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

from ffsubsync.

fakeid30 avatar fakeid30 commented on August 15, 2024

@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]$ 

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

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

from ffsubsync.

fakeid30 avatar fakeid30 commented on August 15, 2024

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]$ 

from ffsubsync.

fakeid30 avatar fakeid30 commented on August 15, 2024

@smacke I have 2 things for you

from ffsubsync.

RealEnder avatar RealEnder commented on August 15, 2024

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.

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

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

from ffsubsync.

fakeid30 avatar fakeid30 commented on August 15, 2024

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

from ffsubsync.

fakeid30 avatar fakeid30 commented on August 15, 2024

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.

from ffsubsync.

schults avatar schults commented on August 15, 2024

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

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

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

from ffsubsync.

schults avatar schults commented on August 15, 2024

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

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

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

from ffsubsync.

pannal avatar pannal commented on August 15, 2024

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

from ffsubsync.

pannal avatar pannal commented on August 15, 2024

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

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

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

from ffsubsync.

LanGuipeng avatar LanGuipeng commented on August 15, 2024

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!

from ffsubsync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.