gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
30.65k stars 2.28k forks source link

Got stuck when using ffmpeg to covert mp3 to wav with gr.Audio inputs #8424

Open vicfullstack opened 1 month ago

vicfullstack commented 1 month ago

Describe the bug

I deployed gradio 4.32.0 in Debian 11/12 server. I used gr.Audio as input. When I upload a mp3 file, it got stuck and consumed all the server's resource which result in the hanging of server. inputs=[gr.Audio(sources=["upload", "microphone"], value="samples/sample_audio.mp3", type="filepath")], It seems when I upload mp3 file, it will convert into wav automatically by ffmpeg, but the command of ffmpeg running in the background will keep running: ffmpeg -y -i xxx.mp3 -acodec pcm_s16le -vn -f wav -

When I am running gradio 4.32.0 in my MacOS 14.5, it works well.

Have you searched existing issues? πŸ”Ž

Reproduction

import gradio as gr

Screenshot

image

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 4.32.0
gradio_client version: 0.17.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.3.0
fastapi: 0.111.0
ffmpy: 0.3.2
gradio-client==0.17.0 is not installed.
httpx: 0.27.0
huggingface-hub: 0.23.2
importlib-resources: 6.4.0
jinja2: 3.1.4
markupsafe: 2.1.5
matplotlib: 3.9.0
numpy: 1.26.4
orjson: 3.10.3
packaging: 24.0
pandas: 2.2.2
pillow: 10.3.0
pydantic: 2.7.2
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.4.6
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.12.0
urllib3: 2.2.1
uvicorn: 0.30.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2024.5.0
httpx: 0.27.0
huggingface-hub: 0.23.2
packaging: 24.0
typing-extensions: 4.12.0
websockets: 11.0.3

Severity

Blocking usage of gradio