bnsantoso / sub-to-audio

Subtitle to audio, generate audio from any subtitle file using Coqui-ai TTS and synchronize the audio timing according to subtitle time.
https://pypi.org/project/subtoaudio/
Mozilla Public License 2.0
104 stars 13 forks source link

Doesn't work at Windows #14

Closed vshlykov closed 10 months ago

vshlykov commented 10 months ago

File "F:\whisper\virtual\lib\site-packages\subtoaudio\subtoaudio.py", line 45, in subtitle input_stream = ffmpeg.input(file_path) AttributeError: module 'ffmpeg' has no attribute 'input'

vshlykov commented 10 months ago

(virtual) F:\whisper>ffmpeg -version ffmpeg version 2023-09-07-git-9c9f48e7f2-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 58. 19.100 / 58. 19.100 libavcodec 60. 26.100 / 60. 26.100 libavformat 60. 11.100 / 60. 11.100 libavdevice 60. 2.101 / 60. 2.101 libavfilter 9. 11.100 / 9. 11.100 libswscale 7. 3.100 / 7. 3.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100

vshlykov commented 10 months ago

I try to test ffmpeg and it's works if I use code like this:

import subprocess

input_file = "input.mp3" output_file = "out.wav"

subprocess.run(["ffmpeg", "-i", input_file, output_file])

bnsantoso commented 10 months ago

AttributeError: module 'ffmpeg' has no attribute 'input' i think you got the wrong ffmpeg-python wraper or something happen when importing.

try unisntall ffmpeg-python first, and install it again. make sure you using this https://github.com/kkroening/ffmpeg-python.

if still error you need find library that have same import name with ffmpeg-python and uninstall it.

vshlykov commented 10 months ago

Thank you very much!